Adding a guidelines link to the Hamburger Menu


(Mark Wilkin) #1

I’ve managed to get a Guidelines link up on the About page by ticking the option for an external FAQ link and linking to a thread on the site.

Is there any way to make this change in the space at the bottom of the Hamburger menu? So you’ve got About, FAQ, Shortcuts and Guidelines links there.


Why is Guidelines called FAQ? Can we link to GUIDELINES and FAQ from hamburger menu?
Custom permalinks not resolving in Hamburger Menu
(Christoph) #2

Bump. I have the exact same question.


(Régis Hanol) #3

Add a new customization In Admin > Customize > CSS/HTML with this in the “Header” tab

<script type="text/discourse-plugin" version="0.4">
  api.decorateWidget('hamburger-menu:footerLinks', () => {
    return { href: 'https://meta.discourse.org/guidelines', rawLabel: 'Guidelines' };
  })
</script>

Customizing About page and other pages
(Mark Wilkin) #4

You’re a star sir :slight_smile:


(Christoph) #5

Note that the same code needs to be added to the mobile version if so desired.


#6

I tried your solution but it won’t work for me.

Tried adding the code into both Header and </head> sections:

But still there’re no traces of the new menu item.
When adding into the </head> I do see the code in loaded page (in DevTools), but it just doesn’t do anything.

Could you suggest what could I miss?


(cpradio) #7

Only add it to </head> and make sure you enable it.

Then refresh your browser window
https://sandbox.cpradio.org/ (you can see that it works)


#8

Exactly:

Are u on v1.8.0.beta7?


(cpradio) #9

Yup. Did you refresh the page?


#10

Sure! Tried other browsers under other users as well )


(cpradio) #11

Can you PM me the URL? I’ll see if I can notice anything, but I’m out of ideas, as I’m running latest and it works fine for me.


(cpradio) #12

Try removing the static-pages plugin from your app.yml. That is throwing an error involving the hamburger menu and maybe causing the code in your </head> to fail.


#13

Yes, it was the reason - removing the static-pages plugin solved the issue. Thanks!


(François Douville) #14

I added this code, it worked! But is it possible to add a link here?

22


(Simon Cossar) #15

Yes, you can do that by changing footerLinks to generalLinks.

api.decorateWidget('hamburger-menu:generalLinks', () => {
  return { href: 'https://meta.discourse.org/guidelines', rawLabel: 'Guidelines' };
});