# איך להציג ווידג'ט בתפריט ההמבורגר?

**URL:** <https://meta.discourse.org/t/how-to-display-a-widget-in-the-hamburger-menu/167022>\
**Category:** Product Support\
**Created:** [12 באוקטובר,‏ 2020,‏ 9:02pm UTC](https://meta.discourse.org/t/how-to-display-a-widget-in-the-hamburger-menu/167022 "2020-10-12T21:02:38Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [14 באוקטובר,‏ 2020,‏ 5:14pm UTC](https://meta.discourse.org/t/how-to-display-a-widget-in-the-hamburger-menu/167022/11 "2020-10-14T17:14:28Z")

</div>

The API was designed with the idea that everything in `generalLinks` would be a `link` widget:

[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/widgets/hamburger-menu.js#L189](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/widgets/hamburger-menu.js#L189)

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:

```javascript
const showModal = require("discourse/lib/show-modal").default;

api.reopenWidget('hamburger-menu', {
  openThing(e) {
     showModal('thing-modal');
  }
});

api.decorateWidget("hamburger-menu:generalLinks", function(helper) {
  return { action: 'openThing', label: 'open.thing' };
});

```

In this case I attach a new action called `openThing` to the hamburger menu, then trigger that via my link.

---

_[View the full topic](https://meta.discourse.org/t/how-to-display-a-widget-in-the-hamburger-menu/167022)._
