# How to add /users on Top Menu?

**URL:** https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611
**Category:** Development
**Created:** [Mai 30, 2017, 1:59 UTC](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611 "2017-05-30T13:59:53Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Filippo\_Ghermandi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/filippo_ghermandi/32/68562_2.png) [@Filippo\_Ghermandi](https://meta.discourse.org/u/Filippo_Ghermandi)
#### Post date: [Mai 30, 2017, 1:59 UTC](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611/1 "2017-05-30T13:59:53Z")

</div>

/users page works properly as a leaderboard. I was willing to add it on top menu.

Is there a easy way to do it? Maybe without code 😛

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [Mai 30, 2017, 10:13 UTC](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611/2 "2017-05-30T22:13:15Z")

</div>

Try this in Customize - Theme - `</head>`

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

  I18n.translations.en.js.filters.users = { title: "Users", help: "User leaderboard" };

  Discourse.NavItem.reopenClass({
    buildList : function(category, args) {
      var list = this._super(category, args);
      list.push(Discourse.ExternalNavItem.create({href: '/users', name: 'users'}));
      return list;
    }
  });
</script>

```

---

<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: [Mai 30, 2017, 10:15 UTC](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611/3 "2017-05-30T22:15:56Z")

</div>

This is sort of there, the big challenge is keeping that nav around when you hit directory, far trickier problem.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [Mai 30, 2017, 11:09 UTC](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611/4 "2017-05-30T23:09:42Z")

</div>

Would it be a big deal to extend the functionality of the `top menu` site setting so that it can handle any url path (based on the site url) in a similar fashion as it now handles `category/<category_name>`?

---

<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: [Mai 31, 2017, 7:03 UTC](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611/5 "2017-05-31T19:03:59Z")

</div>

This is now doable in a theme component.

See: [Add /users to top nav](https://meta.discourse.org/t/add-users-to-top-nav/63681)

> [@tophee](#):
>
> Would it be a big deal to extend the functionality of the top menu site setting so that it can handle any url path

At the moment, yes, it would be a very complex change.

---

<div class="post-metadata">

### Author: ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)
#### Post date: [Mai 27, 2019, 8:01 UTC](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611/6 "2019-05-27T08:01:19Z")

</div>

> [@joebuhlig](#):
>
> Try this in Customize - Theme - `</head>`

Your script is very very useful, in that we can see, in one screenful, the list of all the likes received, given, topics read/written, replies given/viewed, visits to the site. And also all the users are shown very neatly on the map (maps location plugin is installed on my instance). But sorry to find that this whole useful information also becomes available to all users, which is undesired.

Alternatively, if we delete this script and go to Admin\> Settings\> Users, then much info, likes given/received, visits made etc are not shown.  
So, is there a way to disable this view to normal users?

2, As an experiment, I deleted this script, because of this undesired trait, I found that I can still go to that URL, which was there when script was working ([link](https://bathinda.xyz/u/user-map)), and found the user map.

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

Now the question/curiosity is that, while on this page, if I click on ‘Users List’, the button works fine and shows the list of users and their activity as desired (in the URL bar, url now shows as: [https://bathinda.xyz/u](https://bathinda.xyz/u) ).  
But if I refresh this page or later on manually type this url and go to /u page, then nothing is shown and a blank page keeps showing.

What makes it do so?

---

<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: [Décembre 15, 2022, 7:25 UTC](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611/7 "2022-12-15T19:25:18Z")

</div>


