I’d like to display a widget in the hamburger menu. I lookes at How to display "Discord Widget" in a dropdown button to figure it out. but I’m not able to show the button in the hamburger menu.
Here’s my code:
Yes, it shows some normal stuff I guess (when I trigger the modal): (e,t){t=t||{};var n=(0,c.getOwner)(this),s=n.lookup("route:application"),a=s.controllerFor("modal");a.set("modalClass",t.modalClass||"".concat((0,u.dasherize)(e).toLowerCase(),"-modal"));var i=t.admi…
But unless I’m misunderstanding something, my issue isn’t the modal interaction (which works), but placing my widget in the hamburger menu.
I followed this modal creation tutorial and it works perfectly, the custom button shows the modal.
The modal works.
Adding the widget button in a template works and triggers the modal.
Adding a regular link in the hamburger menu works.
…But adding the widget button in the hamburger doesn’t work and creates an empty link instead. Are there some restrictions of some kind when using decorateWidget with “hamburger-menu”?
So the example above is returning another Widget instance, when in fact you need to return one or more javascript object literals like in your working example. Those objects are the arguments to the link widget to make the links appear correctly.
It looks like the reason you want to do this is to open a modal. That’s achievable using an action. Try this: