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.
Ciao! So che questo è un argomento vecchio, ma è quasi quello che sto cercando di fare. Quindi, posto qui (invece di creare un nuovo argomento). Tieni presente che non sono uno sviluppatore, non so come funzionano i plugin e non so scrivere JavaScript. Ma so come copiare e incollare il codice
Quello che sto cercando di fare è aggiungere un accesso a una chatroom all’interno di un menu a tendina. Quindi, voglio un’icona “chat”, e nel menu a tendina ci saranno un campo di input, un pulsante di invio e qualche testo di aiuto o un link alla pagina di aiuto.
Posso adattare il tuo codice, sostituendo l’icona delle “posate” con un’icona “chat”? Come si fa?
In secondo luogo, come posso inserire codice HTML invece della frase “hello world”? (In pratica, come si inserisce HTML lì dentro?)
haha, per caso sto guardando esattamente la stessa cosa anch’io. Penso che il modo migliore sia riaprire il widget del menu hamburger e sovrascrivere il metodo html.
Userò unshift per inserire il mio widget prima della sezione FAQ. Non ho verificato se funziona, ma sarà il mio approccio
Qui sembra funzionare