# Add button to top navigation bar

**URL:** <https://meta.discourse.org/t/add-button-to-top-navigation-bar/49552>\
**Category:** Development\
**Created:** [1. September 2016 um 11:59 UTC](https://meta.discourse.org/t/add-button-to-top-navigation-bar/49552 "2016-09-01T11:59:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![kgish](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kgish/32/121131_2.png) [@kgish](https://meta.discourse.org/u/kgish)\
**Post date:** [1. September 2016 um 21:07 UTC](https://meta.discourse.org/t/add-button-to-top-navigation-bar/49552/3 "2016-09-01T21:07:20Z")

</div>

CSS will not work, so I resorted to the following solution which I happed to find elsewhere on the forum:

```plaintext

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

// Add navigation button 'Mijn berichten'

Discourse.NavItem.reopenClass({
    buildList : function(category, args) {
        console.log(`NavItem#buildList(), category="${category?category.get('name'):'null'}", args="${JSON.stringify(args)}"`);
        var list = this._super(category, args);
        if (!category && args.filterMode !== 'posted') {
            console.log('NavItem#buildList() => add posted button ');
            list.push(Discourse.ExternalNavItem.create({href: '/posted', name: 'posted'}));
        }
        return list;
    }
});

```

---

_[View the full topic](https://meta.discourse.org/t/add-button-to-top-navigation-bar/49552)._
