# Allowing Admins to place arbitrary links in topnav

**URL:** <https://meta.discourse.org/t/allowing-admins-to-place-arbitrary-links-in-topnav/58264>\
**Category:** Feature\
**Created:** [2017 年3 月 3 日 00:41 UTC](https://meta.discourse.org/t/allowing-admins-to-place-arbitrary-links-in-topnav/58264 "2017-03-03T00:41:16Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
发布日期： [2017 年3 月 3 日 00:41 UTC](https://meta.discourse.org/t/allowing-admins-to-place-arbitrary-links-in-topnav/58264/1 "2017-03-03T00:41:16Z")

</div>

Requests for admins to be able to add links to the topnav come up reasonably often here on Meta.

There’s this one:

> [@Why we can't add groups to top menu](https://meta.discourse.org/t/why-we-cant-add-groups-to-top-menu/54968):
>
> Is there a way to add groups to top menu ? My /admin/site\_settings/category/basic top\_menu settings looks like But I do not get Groups at top menu. I’ll love to add grop page to top menu so users can join freely My Discourse is at v1.7.0.beta10 +149 Version

There’s also this one, with discussion spanning 3 years!  
[https://meta.discourse.org/t/how-to-add-external-link-on-top-menu/9508?u=jomaxro](https://meta.discourse.org/t/how-to-add-external-link-on-top-menu/9508)

Back in 2015, Jeff said:

> [@What about adding tags in the top menu?](https://meta.discourse.org/t/what-about-adding-tags-in-the-top-menu/25501/10):
>
> I have said for a long time .. it’s criminal that we don’t **allow admins to place arbitrary links in topnav.**
> 
> That would solve this and many more issues.

Sam responded:

> [@What about adding tags in the top menu?](https://meta.discourse.org/t/what-about-adding-tags-in-the-top-menu/25501/11):
>
> Adding the links is the easy part, the hard part is maintaining the breadcrumb. If we allowed admins to add “Tags” or “Users” there we also need to allow to carry the top nav around and keep it highlighted.

At the moment, the solution for this issue seems to be adding custom JS to the `</body>`. While this works, it’s not exactly user friendly (you need a basic JS understanding to add or change links), and could break at any time with a code change to Discourse.

I’d like to suggest the following 3-stage rollout:

1. Provide a site setting for admins to add _external_ links to the topnav. The site setting will need 3 values, I propose a comma separated list. `title,tooltip,URL`
2. Provide a site setting for admins to add _internal_ links to the topnav - without handling breadcrumbs.
3. Improvinate #2 by handling certain cases where breadcrumbs make sense, like Tags, Users, Groups, Badges, etc.

The benefit to the 3-stage rollout is that _external_ links require no routing by Discourse, nor breadcrumb support. They should simply be an `href`. Keeping steps 2 & 3 separate will allow for complaint driven development. Roll-out internal link support, see if there are complaints about the lack of breadcrumbs. Meta already has 2 internal links without breadcrumb support, and I’ve never seen a complaint.

---

_[View the full topic](https://meta.discourse.org/t/allowing-admins-to-place-arbitrary-links-in-topnav/58264)._
