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.
Olá! Sei que este é um tópico antigo, mas é quase exatamente o que estou procurando/tentando fazer. Por isso, estou postando aqui (em vez de criar um novo tópico). Por favor, tenha em mente que não sou desenvolvedor, não sei como os plugins funcionam e não consigo escrever JavaScript. Mas sei copiar e colar código
O que estou tentando fazer é adicionar um login a um chatroom dentro de um menu suspenso. Assim, quero um ícone de “chat”, e no menu suspenso haverá um campo de entrada, um botão de enviar e algum texto de ajuda / link para a página de ajuda.
Posso adaptar seu código, substituindo o ícone de “talheres” por um ícone de “chat”? Como faço isso?
E, em segundo lugar, como posso inserir código HTML em vez da frase “hello world”? (basicamente, como inserir HTML ali?)
Haha, por coincidência, estou olhando exatamente para a mesma coisa também. Acredito que a melhor maneira é reabrir o widget do menu hambúrguer e sobrescrever o método html.
Vou unshift meu widget na frente do item de FAQ. Não verifiquei se funciona, mas será minha abordagem
Aqui parece funcionar: