How to make some categories like Bugs and Features here visible in top menu?

(Dmitry Krasnoperov) #1

How to make some categories like Bugs and Features here visible in top menu?

(Simon Cossar) #2

If you view the source on this page you can see the script that adds bugs and features to the top menu - it’s the last script tag on the page.

 Discourse.ExternalNavItem = Discourse.NavItem.extend({
    href : function() {
      return this.get('href');

  I18n.translations[I18n.locale].js.filters.bugs = { title: "Bugs", help: "Open Bugs" };
  I18n.translations[I18n.locale].js.filters.features = { title: "Features", help: "Open Feature Requests" };
    buildList : function(category, args) {
      var list = this._super(category, args);
      if(!category) {
        list.push(Discourse.ExternalNavItem.create({href: '/c/bug/l/top/quarterly?status=open', name: 'bugs'}));
        list.push(Discourse.ExternalNavItem.create({href: '/category/feature?order=op_likes&status=open', name: 'features'}));
      return list;

(Felix Freiberger) #3

If you only want to add a category, not a special filtered view, you can also edit the site setting top menu and add something like category/feature to it.

(Dmitry Krasnoperov) #4

Thanks guys! Thanks guys!

(Dmitry Krasnoperov) #5

Where do I need to put this adapted script?


Admin > Customize > CSS/HTML

Create a new CSS and add the code in </body>

(Simon Cossar) #7

This might be a better solution for you. To add the ‘Persian’ category I added ‘category/persian’ to basic setup/top menu.


We learn something everyday with Discourse

(Dmitry Krasnoperov) #9

I’m sorry, but your methods doesn’t work for me.

  1. I took the category name from — “offtopik”

  2. Then put it into “category/offtopik”

  3. It does appeared on top menu

it points to - NULL
it doesn’t use normal name.

(Simon Cossar) #10

It looks like you need to use the category name, not the slug.

(Dmitry Krasnoperov) #11

Yeeaaah! It works! Thanks

(Dmitry Krasnoperov) #12

Looks like magic is broken. I can’t add more sub-categories in Top menu

(David Taylor) #13

The best way to do this now is with a theme component: