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.
¡Hola! Sé que este es un tema antiguo, pero es casi exactamente lo que busco/intento hacer. Por eso publico aquí (en lugar de crear un nuevo tema). Por favor, ten en cuenta que no soy desarrollador, no sé cómo funcionan los complementos y no puedo escribir JavaScript. Pero sé cómo copiar y pegar código
Lo que intento hacer es agregar un inicio de sesión a un chat dentro de un menú desplegable. Es decir, quiero un icono de “chat”, y en el menú desplegable habrá un campo de entrada, un botón de enviar y algún texto de ayuda o un enlace a la página de ayuda.
¿Puedo adaptar tu código para usar un icono de “chat” en lugar del icono de “cubiertos”? ¿Cómo se hace eso?
Y en segundo lugar, ¿cómo puedo insertar código HTML en lugar de la frase “hola mundo”? (Básicamente, ¿cómo se introduce HTML allí?)
Jaja, por coincidencia, ¡también estoy mirando exactamente lo mismo! Creo que la mejor manera es volver a abrir el widget del menú hamburguesa y anular el método html.
Voy a insertar mi widget antes del elemento de preguntas frecuentes. No he verificado si funciona, pero ese será mi enfoque
Aquí parece que funciona: