# Is there any way to remove subcategories from the hamburger menu

**URL:** https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799
**Category:** UX
**Tags:** pr-welcome
**Created:** [2월 22, 2017, 5:25오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799 "2017-02-22T17:25:21Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2월 22, 2017, 5:25오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/1 "2017-02-22T17:25:21Z")

</div>

in the meta drop down menu next to user avatar, only categories are shown . This keeps the menu clean .

I couldn’t find any option in the setting searching for subcategory, how can I remove subcategories from the menu?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2월 22, 2017, 6:37오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/2 "2017-02-22T18:37:04Z")

</div>

> [@Pad\_Pors](#):
>
> in the meta drop down menu next to user avatar, only categories are shown .

I guess I’m not understanding what you’re saying. The categories that show in the hamburger menu display all the categories I have permission to. Both parent categories and child categories.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2월 22, 2017, 6:40오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/3 "2017-02-22T18:40:30Z")

</div>

You’re looking for this setting: `Show subcategory list instead of topic list when entering a category.`

Strangely, as far as I can tell, this controls both the display of subcategories in the hamburger menu, and whether they appear in the topic list - they can’t be controlled independently.

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [2월 22, 2017, 6:51오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/4 "2017-02-22T18:51:09Z")

</div>

> [@Pad\_Pors](#):
>
> in the meta drop down menu next to user avatar, only categories are shown . This keeps the menu clean .

You don’t see this subcategory in the dropdown? [https://meta.discourse.org/c/plugin/extras](https://meta.discourse.org/c/plugin/extras)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2월 22, 2017, 7:23오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/5 "2017-02-22T19:23:30Z")

</div>

He is trying to hide them. I think…

Taking Meta as an example, he wants to hide the highlighted items

 ![](https://global.discourse-cdn.com/meta/original/3X/7/1/711d275e293dfdd47047971a12153a7d04569d9d.png)

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [2월 22, 2017, 7:29오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/6 "2017-02-22T19:29:37Z")

</div>

Thanks for the screenshot! Yes I think he wants to hide them

> [@Pad\_Pors](#):
>
> only categories are shown

but its looks like meta is also showing subcategories so we aren’t doing anything special either to show only categories. You will probably have to do some css magic, create a plugin, or create a setting for this and make a pr.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2월 22, 2017, 7:31오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/7 "2017-02-22T19:31:04Z")

</div>

I’m confused, does the site setting I mentioned above not work? It seems to work fine for me…

Enabled:

 ![](https://global.discourse-cdn.com/meta/original/3X/3/d/3d751e0a772f7c22b942c4fafed1f92a3abca468.png)

Disabled:

 ![](https://global.discourse-cdn.com/meta/original/3X/c/2/c24fa25cbb34514e4850e29cc86f29799703a9b6.png)

* * *

Edit: Keep in mind, it’s also affecting the following…

Enabled:

 ![](https://global.discourse-cdn.com/meta/original/3X/1/7/178c846cb875ba7faf993f585004c0bda6569556.png)

Disabled:

 ![](https://global.discourse-cdn.com/meta/original/3X/2/c/2c0170da371b5b603020a83cecb7b4ba0f99d1eb.png)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2월 22, 2017, 7:32오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/8 "2017-02-22T19:32:13Z")

</div>

Works on my sandbox (never knew that setting also controlled that list)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2월 22, 2017, 7:34오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/9 "2017-02-22T19:34:52Z")

</div>

@blake, can I infer from your post that separating the hamburger list and the topic list subcategory settings would be #pr-welcome?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2월 22, 2017, 7:37오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/10 "2017-02-22T19:37:02Z")

</div>

What feature exactly are you asking for?

A discreet site setting for “hamburger only shows top level categories” ?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2월 22, 2017, 7:37오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/11 "2017-02-22T19:37:48Z")

</div>

> [@sam](#):
>
> A discreet site setting for “hamburger only shows top level categories” ?

Yes. I’d like to be able to control the hamburger menu independently of the topic list.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2월 22, 2017, 7:40오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/12 "2017-02-22T19:40:15Z")

</div>

A pr that adds the `.subcategory` class to the enclosing LI is welcome. Then you can do it with CSS.

A site setting is @codinghorror’s call

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2월 22, 2017, 7:45오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/15 "2017-02-22T19:45:36Z")

</div>

I’ll take a stab at it after work.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2월 22, 2017, 7:49오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/16 "2017-02-22T19:49:34Z")

</div>

For reference, this is the file in question  
[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/hamburger-categories.js.es6](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/hamburger-categories.js.es6)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2월 23, 2017, 5:36오전 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/17 "2017-02-23T05:36:29Z")

</div>

OK - so I’ve been digging into this for quite some time now. First time working with widgets, so it took me some time to wrap my head around how everything works.

It looks like @neil committed a new feature that changes the way this works about 12 hours before @Pad_Pors’s first post. I believe this commit explains why we’re now seeing subcategories in the Meta hamburger menu. Primarily, the site setting I mentioned above doesn’t exist anymore. Secondly, I believe the commit as it currently stands is broken. Here’s the commit:  
[https://github.com/discourse/discourse/commit/a702330ccdfa46a3e110f4df852f451975c51d30](https://github.com/discourse/discourse/commit/a702330ccdfa46a3e110f4df852f451975c51d30)

The commit appears to remove the site setting in favor of a per-category setting.

Here’s the line that I believe is broken (no idea how to fix it):  
[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6#L123](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6#L123)

If I understand correctly, it says that “if the current category has `show_subcategory_list` enabled **and** the category has a parent category, return true”, and thus don’t add said category to the list. The problem is only a parent category can have the `show_subcategory_list` setting enabled, and parent categories can’t have parents, so this will never be true. It should be “if the current category’s _parent_ has `show_subcategory_list` enabled and …”

I’ve still not figured out how to modify the CSS for subcategories only, but before I continue working I wanted to ensure my understanding of the code is correct, and ensure I’m hacking at working code.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2월 23, 2017, 5:46오전 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/18 "2017-02-23T05:46:15Z")

</div>

Probably a bug, @neil will look at it Monday when he is back.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [2월 27, 2017, 9:12오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/19 "2017-02-27T21:12:24Z")

</div>

Yeah that was a bug. Fixed!

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2월 28, 2017, 6:41오전 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/20 "2017-02-28T06:41:06Z")

</div>

> [@jomaxro](#):
>
> Show subcategory list instead …

I have upgraded to latest but I can’t fine this setting yet, should I wait more or is this option gone?

- I can see the hamburger menu of meta is clean again, so I guess there should be a way to activate this now. is there?

 ![](https://global.discourse-cdn.com/meta/original/3X/b/4/b4b260cc46c84a3d3c4cb7ddb94202b5fab8631f.png)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2월 28, 2017, 12:20오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/21 "2017-02-28T12:20:31Z")

</div>

It is on each Category. So visit the Category, choose Edit Category, and it should be in one of the tabs.

---

<div class="post-metadata">

### Author: ![scistoryteller](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@scistoryteller](https://meta.discourse.org/u/scistoryteller)
#### Post date: [3월 3, 2017, 9:02오후 UTC](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799/22 "2017-03-03T21:02:09Z")

</div>

I am having a similar difficulty. The hamburger menu is showing ALL my categories (including subcategories). I went in to the categories that have subcategories and selected subcategory list. That changed the category pages, but not the hamburger menu. So I’m not sure what to do.

[다음 페이지](https://meta.discourse.org/t/is-there-any-way-to-remove-subcategories-from-the-hamburger-menu/57799.md?page=2)
