# Ajoutez le bouton Non résolu au menu supérieur en utilisant HTML personnalisé

**URL:** https://meta.discourse.org/t/add-unsolved-button-to-top-menu-using-custom-html/59758
**Category:** Development
**Tags:** how-to
**Created:** [Mars 23, 2017, 11:50 UTC](https://meta.discourse.org/t/add-unsolved-button-to-top-menu-using-custom-html/59758 "2017-03-23T11:50:18Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [Mars 23, 2017, 11:59 UTC](https://meta.discourse.org/t/add-unsolved-button-to-top-menu-using-custom-html/59758/2 "2017-03-23T11:59:10Z")

</div>

That works great, if you want to only display the buttons on certain categories then you can do some fairly simple logic to check the category name. I also filter out “closed” topics for my “unsolved” button.

This is what I use:

```plaintext
<script>
  Discourse.ExternalNavItem = Discourse.NavItem.extend({
    href : function() {
      return this.get('href');
    }.property('href'),
  });

  I18n.translations.en.js.filters.Completed = { title: "Completed", help: "Topics that have been marked as solved" };
  I18n.translations.en.js.filters.Outstanding = { title: "Outstanding", help: "Topics that are not yet marked as solved" };

  Discourse.NavItem.reopenClass({
    buildList : function(category, args) {
     var list = this._super(category, args);
     if(!category) {
          //Don't display anything
     }else if(category.slug==='support') {
        list.push(Discourse.NavItem.create({href: '/c/support?solved=yes', name: "Completed"}));
        list.push(Discourse.NavItem.create({href: '/c/support?solved=no&status=open', name: "Outstanding"}));
      }else if(category.slug==='jobs') {
        list.push(Discourse.NavItem.create({href: '/c/jobs?solved=yes', name: "Completed"}));
        list.push(Discourse.NavItem.create({href: '/c/jobs?solved=no&status=open', name: "Outstanding"}));
      }
      return list;
    }
  });
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/add-unsolved-button-to-top-menu-using-custom-html/59758)._
