Custom hamburger menu links

theme-component

(Joe) #1

This is a theme component that will allow you to easily add links the hamburger menu.


Repository link
https://github.com/hnb-ku/discourse-custom-hamburger-links

Preview:
https://theme-creator.discourse.org/theme/Johani/hamburger-links


Samples

Desktop

Mobile


Settings

You add links via comma delimited values in this order:

Text,URL,Location

Text
is the name of the link that shows on the menu.

URL
is the path you want the link to have. You can use relative paths like

/tags/funny
or
/t/231

if you prefer.

Location
can have one of two values. Either the letter g or the letter f

Use “g” if you want the link to appear in the generalLinks section:

or use “f” if you want the link to appear in the footerLinks section:


How do I install this theme?

follow the official theme installation guide here:

Then add the component to your theme as a theme component and you’re all set!


Login Required activated - after successfull login it transfers you to nonexisting page
Navigation - Add custom menu items
How can i add custom hamburger menu
(Steven) #2

Thats a nice addition, thanks for that. It’s already installed :smiley:

Could you add a target option so that it is possible to open the link in a new tab/window (if no target is given just use “_self”)

Text,URL,Location,Target


(David Kingham) #3

Any idea why this wouldn’t show up in my list of theme components?

I tried rebuilding the app twice and haven’t any problems with other plugins

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/angusmcleod/discourse-topic-previews.git
          - git clone https://github.com/davidtaylorhq/discourse-whos-online.git
          - git clone https://github.com/davidtaylorhq/discourse-category-lockdown.git
          - git clone https://github.com/hnb-ku/discourse-custom-hamburger-links.git

(Joe) #4

I believe you followed the plugin installation instructions to install the theme. It won’t work that way.

You should install it as a theme. It would then show up in your list of themes.


(David Kingham) #5

Now I feel stupid, I was in plugin installation mode. Thank you sir!


(Sami Syed) #6

Is it possible to separate custom added menu links with the grey line?


(Helmi) #7

Any idea why the forum doesn’t render at all as soon as I add this component to my theme?

Using the default theme without a lot modification and your navigation links component (which works fine).


(Joe) #8

Possibly, yes @Sami_Syed but it’s beyond the scope of this theme.

Not sure @helmi, I just checked and everything seems ok

Are you seeing any errors in the browser console?


(Helmi) #9

Yeah, “ReferenceError: loc is not defined”

Problem is that I can’t even disable it now as the admin area is affected, too.


(Joe) #10

You can use safe-mode to disable your current theme.

go to

your.site.com/safe-mode

More on that here


(Helmi) #11

Thanks, that helped me out. I still can’t figure out what’s wrong. It doesn’t even matter if I put links in the settings or not - tried external and internal links. Weird.

Also tried removing all other components (Nav Links component only) but that didn’t change anything. As soon as I add this component rendering breaks.


(Joe) #12

I just pushed a small fix. Please update the theme and then try again and let me know what happens.


(Helmi) #13

Thanks, that fixed it. Additionally I found out that I had used semi colons as separator instead of commas :crazy_face: