# Need help getting widget to show category list count and labels (after I removed category prefix and added category pages)

**URL:** <https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242>\
**Category:** support\
**Tags:** taxonomy\
**Created:** [September 16, 2023, 7:15am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242 "2023-09-16T07:15:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_Jones](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juan_jones/32/20334_2.png) [@Juan\_Jones](https://discourse.gohugo.io/u/Juan_Jones)\
**Post date:** [September 16, 2023, 7:15am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/1 "2023-09-16T07:15:10Z")

</div>

Heres the scenario, Im using a hugo starter template, and decap cms for admin settings to write blog post ect. The template (geeky-hugo) Im using has a sidebar widget that display the number of post in each category. It also displays the category label on the posts image. Now the problem is my blog does not show the category count for any posts that I published using decap cms nor does it place labels any categories. I did make two major changes. First I removed the category prefix from the URL. And I added category pages to the template. Any help. I been working on this for months.

---

<div class="post-metadata">

**Author:** ![Arif](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arif/32/20931_2.png) [@Arif](https://discourse.gohugo.io/u/Arif)\
**Post date:** [September 16, 2023, 7:45am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/2 "2023-09-16T07:45:53Z")

</div>

You should direct this question to the theme author on GitHub.

---

<div class="post-metadata">

**Author:** ![Juan\_Jones](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juan_jones/32/20334_2.png) [@Juan\_Jones](https://discourse.gohugo.io/u/Juan_Jones)\
**Post date:** [September 16, 2023, 8:06am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/3 "2023-09-16T08:06:36Z")

</div>

I edited the theme, it was working fine. However I need my blog url to render without the category prefix in the URL and I added category pages along with decap cms. I think the problem might be in the config.yml settings; The field is named Category in that setting however for my blogs and everything else its label Categories, on the left is a snapshot of the config.yml file and the right a index page for a category. ⬆

 ![dShot 2023-09-16 at 12.54.15 AM](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/7/8/7821d1e0e33057d47a70dbd2cd904fcac1963eef.jpeg)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [September 16, 2023, 9:13pm UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/4 "2023-09-16T21:13:42Z")

</div>

> [@Juan\_Jones](#):
>
> I been working on this for months

We don’t have enough information to help you.

You are more likely to receive a prompt and accurate response if you post a link to the public repository for your project.

See [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132).

> Let us see your code
> 
> Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
> 
> If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [September 17, 2023, 12:09am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/6 "2023-09-17T00:09:10Z")

</div>

1) You have page collisions. Run hugo with the `--printPathWarnings` flag for details. Fix it by removing the items indicated below:

config.toml

```auto
[taxonomies]
  tags = "tags"
  category = "categories"
  ecommerce = "ecommerce" # delete this
  entrepreneurship = "entrepreneurship" # delete this
  gig-economy = "gig economy" # delete this
  investing = "investing" # delete this
  monetizing = "monetizing" # delete this
  online-business = "online business" # delete this
  personal-finance = "personal finance" # delete this
  side-hustle = "side hustles" # delete this

```

2) In your content/categories/whatever/\_index.md files, remove the `url` field. You’ve already taken care of that with the `permalinks` setting in your site configuration.

3) In your content/categories/whatever/\_index.md files, remove the `categories` field. You apply a taxonomy term to content, not to the term’s list page.

4) In your blog content pages, sometimes you specify `category` instead of `categories` in front matter. Always use the plural.

5) In your blog content pages, each `categories` field must be an array. A few of the files have a scalar value, and you can’t range over that.

---

<div class="post-metadata">

**Author:** ![Juan\_Jones](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juan_jones/32/20334_2.png) [@Juan\_Jones](https://discourse.gohugo.io/u/Juan_Jones)\
**Post date:** [September 17, 2023, 12:38am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/7 "2023-09-17T00:38:22Z")

</div>

My goal was to remove the category prefix. Would this edit make the category prefix appear in the URL again?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [September 17, 2023, 12:40am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/8 "2023-09-17T00:40:24Z")

</div>

In your local development environment, make the changes that I suggested, and then test.

---

<div class="post-metadata">

**Author:** ![Juan\_Jones](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juan_jones/32/20334_2.png) [@Juan\_Jones](https://discourse.gohugo.io/u/Juan_Jones)\
**Post date:** [September 17, 2023, 12:50am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/9 "2023-09-17T00:50:13Z")

</div>

So for the blog content pages that specify as categories; thats another issue I was trying to figure out. When I added decap CMS the label fields format was like so. When I tried to change to structure my post failed. But i when i edited the category prefix in config.yml to return as categories I couldn’t access my category pages. But i think with the updates you mentioned it will help so im gonna work on em now. Thanks for the help, Ill give you an update here shortly.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [September 17, 2023, 12:51am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/10 "2023-09-17T00:51:40Z")

</div>

Yeah, this is wrong too:

```plaintext
 - {label: "Category", name: "category", ...

```

The `name` must be plural to match your taxonomy definition. And it should be a list (array) not a scalar.

See [example](https://github.com/jmooring/hosting-netlify-decap-cms/blob/main/static/admin/config.yml#L25-L37).

---

<div class="post-metadata">

**Author:** ![Juan\_Jones](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juan_jones/32/20334_2.png) [@Juan\_Jones](https://discourse.gohugo.io/u/Juan_Jones)\
**Post date:** [September 17, 2023, 2:27am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/11 "2023-09-17T02:27:21Z")

</div>

That was it, thanks for the help!!! 👍 👍

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [September 19, 2023, 2:28am UTC](https://discourse.gohugo.io/t/need-help-getting-widget-to-show-category-list-count-and-labels-after-i-removed-category-prefix-and-added-category-pages/46242/12 "2023-09-19T02:28:06Z")

</div>

Closed on September 19, 2023, 2:28am UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
