# Custom nav items no longer showing after recent update

**URL:** https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838
**Category:** Support
**Created:** [November 19, 2019, 5:09pm UTC](https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838 "2019-11-19T17:09:31Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [November 19, 2019, 5:09pm UTC](https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838/1 "2019-11-19T17:09:31Z")

</div>

I use this code (in the /head tab of the edit CSS/HTML customisation page) to add some additional items to the menu, however it’s stopped working after a recent update - anybody know why?

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

    I18n.translations.en.js.filters.first_name_here = { title: "Name", help: "Name again" };
    I18n.translations.en.js.filters.second_name_here = { title: "Name", help: "Visit our...." };
    I18n.translations.en.js.filters.tags = { title: "Tags", help: "Tags" };

    Discourse.NavItem.reopenClass({
      buildList : function(category, args) {
        var list = this._super(category, args);
        if(!category) {
          list.push(Discourse.ExternalNavItem.create({href: 'http://forum.com/tags', name: 'tags'}));
          list.push(Discourse.ExternalNavItem.create({href: 'https://forum.com/something', name: 'name'}));
          list.push(Discourse.ExternalNavItem.create({href: 'https://forum.com/t/thread-url/193454#heading--name', name: 'name'}));
        }
        return list;
      }
    });
  </script>

```

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [November 19, 2019, 5:28pm UTC](https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838/2 "2019-11-19T17:28:18Z")

</div>

> [@AstonJ](#):
>
> Discourse.NavItem

does not exist in core anymore. If you want to add items to the top nav menu, you can use this component

> [@Custom Top Navigation Links](https://meta.discourse.org/t/custom-top-navigation-links/87225):
>
> discourse2Summary Custom Top Navigation Links allows you to add links to Discourse top navigation.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/custom-top-navigation-links)hammer_and_wrenchRepository Link [https://github.com/discourse/Discourse-nav-links-component](https://github.com/discourse/Discourse-nav-links-component)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features Desktop Mobile Settings: …

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [November 19, 2019, 8:13pm UTC](https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838/3 "2019-11-19T20:13:17Z")

</div>

Thanks Joe - added!

Only thing is it seems to be stripping out the #jump to?

`forum.com/t/thread-url/193454#heading--name`

Edit: it seems it’s there and if you copy and pate the URL it works fine, but clicking on it in the nav, it gets stripped out and you just go to the top of the topic. Any ideas why?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [November 19, 2019, 10:01pm UTC](https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838/4 "2019-11-19T22:01:08Z")

</div>

Sounds like

[https://meta.discourse.org/t/deep-linking-to-headings-anchors/47552/36?u=falco](https://meta.discourse.org/t/deep-linking-to-headings-anchors/47552/36)

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [November 19, 2019, 11:28pm UTC](https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838/5 "2019-11-19T23:28:53Z")

</div>

Thanks Rafael, I’m pretty sure it used to work so I’m guessing it’s a recent change..

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [December 8, 2019, 5:01am UTC](https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838/6 "2019-12-08T05:01:52Z")

</div>

> [@AstonJ](#):
>
> Only thing is it seems to be stripping out the #jump to?

This was tricky to track, but @j.jaffeux 🧙 added a fix for that here

[https://github.com/discourse/discourse/commit/c5140ef3fb3146eb5a580beda254ae2bf4b6002c](https://github.com/discourse/discourse/commit/c5140ef3fb3146eb5a580beda254ae2bf4b6002c)

It should work if your Discourse is up to date.

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [December 8, 2019, 6:06am UTC](https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838/7 "2019-12-08T06:06:36Z")

</div>

Fantastic - it works!!!

Thank you @Johani and @j.jaffeux 🧡

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [January 7, 2020, 6:13am UTC](https://meta.discourse.org/t/custom-nav-items-no-longer-showing-after-recent-update/133838/8 "2020-01-07T06:13:19Z")

</div>

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