# ユーザーメニューにリンクを追加

**URL:** <https://meta.discourse.org/t/add-link-in-user-menu/85949>\
**Category:** Support\
**Created:** [2018 年 4 月 23 日午前 8:33 UTC](https://meta.discourse.org/t/add-link-in-user-menu/85949 "2018-04-23T08:33:28Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Osama](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osama/32/98013_2.png) [@Osama](https://meta.discourse.org/u/Osama)\
**Post date:** [2018 年 4 月 25 日午後 2:08 UTC](https://meta.discourse.org/t/add-link-in-user-menu/85949/6 "2018-04-25T14:08:01Z")

</div>

So I took this as a challenge to test my skills and to try out Theme Creator and here is what I’ve got for you 🙂

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/a/2a29a253c81f784f2f3e78b94e03f83dc531bd0e.png)

Thanks to Theme Creator, you can try out this theme component live here: [https://theme-creator.discourse.org/theme/Osama/extend-user-menu](https://theme-creator.discourse.org/theme/Osama/extend-user-menu)

Here is the code under Common in the \</head\> section:

```plaintext
<script type="text/discourse-plugin" version="0.8.13">
  const h = require('virtual-dom').h;
  I18n.translations.en.js.user.my_link = "My Link";
  api.reopenWidget('user-menu', {
      myLinkAction() {
          console.log("Hello there!"); // handle click on the link here
      },
      panelContents() {
        const sup = this._super(...arguments);
        sup.push(
          h('div.my-link', [
            h('ul.menu-links',
              h('li',
                this.attach('link', {
                  action: 'myLinkAction',
                  className: 'my-link',
                  icon: 'link',
                  label: 'user.my_link'
                })
              )
            )
          ])
        );
        return sup;
      }
  })
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/add-link-in-user-menu/85949)._
