I could create the hamburger and menu with my knowledge of css/html/js. But I was hoping for a way to use the functionality that discourse has already implemented (opening, closing, etc…).
Any suggestions on how to achieve this?
I thought maybe I would be able to extend the widget for the current navigation, change the settings, then attach it to the html I have written for my nav. But the connectors seemed to be predefined, and I wasnt sure how to connect my widget to my html. This might not be the right direction at all either…
This is slightly rough but should get you 99% of the way there when it comes to having an additional menu item with a dropdown panel. Calling this one a pizza menu . Add this to your header.html file.
Ah ok in that case you’re looking at something more like what @simon mentioned in the brand header theme component, I was attaching the action to the existing header widget… the brand header adds it to a new one. The new widget here w/ toggleHamburger:
Thank you for this code. Can you point me in the right direction on filling out the panelContents? I see some indication, but not sure how it all links together.
Hallo! Ich weiß, dass dies ein altes Thema ist, aber es kommt dem, was ich suche/versuche zu tun, fast sehr nahe. Deshalb poste ich hier (anstatt ein neues Thema zu erstellen). Bitte beachte, dass ich kein Entwickler bin und nicht weiß, wie die Plugins funktionieren oder wie man JavaScript schreibt. Aber ich weiß, wie man Code kopiert und einfügt
Was ich versuchen möchte, ist, eine Anmeldung für einen Chatroom in ein Dropdown-Menü einzubinden. Ich möchte also ein “Chat”-Symbol haben, und im Dropdown-Menü soll ein Eingabefeld und ein Absende-Button sowie ein Hilfetext/Link zur Hilfeseite enthalten sein.
Kann ich deinen Code dann anpassen, indem ich statt des ‘Besteck’-Symbols ein ‘Chat’-Symbol verwende? Wie mache ich das?
Und zweitens: Wie kann ich HTML-Code anstelle der ‘Hello World’-Anweisung einfügen? (Im Grunde: Wie gibt man dort HTML ein?)
Haha, zufälligerweise schaue ich mir genau dasselbe an. Ich denke, der beste Weg ist, das Hamburger-Menü-Widget erneut zu öffnen und die html-Methode zu überschreiben.
Ich werde mein Widget mit unshift vor das FAQ-Element einfügen. Ich habe noch nicht geprüft, ob es funktioniert, aber das ist mein Ansatz
Hier scheint es zu funktionieren: