# 如何在“新建主题”按钮旁边添加按钮？

**URL:** https://meta.discourse.org/t/how-do-we-add-buttons-next-to-the-new-topic-button/112743
**Category:** Support
**Created:** [2019年三月27日 18:40 UTC](https://meta.discourse.org/t/how-do-we-add-buttons-next-to-the-new-topic-button/112743 "2019-03-27T18:40:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![labofoz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/labofoz/32/135498_2.png) [@labofoz](https://meta.discourse.org/u/labofoz)
#### Post date: [2019年三月27日 18:40 UTC](https://meta.discourse.org/t/how-do-we-add-buttons-next-to-the-new-topic-button/112743/1 "2019-03-27T18:40:53Z")

</div>

Is there an API to add new buttons next to or underneath the New Topic button - or where the New Topic button would go if logged out? I’d like to create an “Action” button with similar functionality to the Categories Button; when a user clicks it a dropdown should appear

I could definitely do it with jQuery, but I’d like to be able to switch out themes

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/9/e9d070f95016b8348fc93ebc4c92142a5851eafe.png)

* * *

This is the script I’m currently using to add a button to the very top menu, which I put in my themes `common/head_tag.html`:

![image](https://global.discourse-cdn.com/meta/original/3X/7/d/7d543a96c7b1c14ba8b1a34eb1d40358f146ac22.png)

```xml
<script type="text/discourse-plugin" version="0.4">
  api.decorateWidget('header-icons:before', helper => {
      return [
        helper.h('li', [
            helper.h('a.handsfree-show-when-stopped.handsfree-start.icon', {
                title: 'start webcam and enable handsfree'
            }, helper.h('i.fab.fa-video.home-button-icon.d-icon')),
        ]),
        helper.h('li', [
            helper.h('a.handsfree-show-when-started.handsfree-stop.icon', {
                title: 'stop webcam and disable handsfree'
            }, helper.h('i.fab.fa-video.home-button-icon.d-icon')),
        ])
      ]
  });
</script>

```

Is there something like that but for the New Topic section?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2019年三月27日 18:55 UTC](https://meta.discourse.org/t/how-do-we-add-buttons-next-to-the-new-topic-button/112743/2 "2019-03-27T18:55:23Z")

</div>

You’d want to use a plugin-outlet for this, `discovery-list-container-top` would work.

```xml
<script type="text/x-handlebars" data-template-name="/connectors/discovery-list-container-top/custom-name"> 
  <button> your button here </button>
</script>

```

 ![02%20PM](https://global.discourse-cdn.com/meta/original/3X/5/2/524ffc73a652df095c1497ebe804ffe67c3d7a6c.png)

It would just take a bit of additional CSS to align it to the right instead of the left.

There’s more on handlebars templates and plugin outlets in [Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648/1#heading--4-b)

---

<div class="post-metadata">

### Author: ![labofoz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/labofoz/32/135498_2.png) [@labofoz](https://meta.discourse.org/u/labofoz)
#### Post date: [2019年三月27日 19:01 UTC](https://meta.discourse.org/t/how-do-we-add-buttons-next-to-the-new-topic-button/112743/3 "2019-03-27T19:01:36Z")

</div>

Thanks, that’s perfect!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2019年四月26日 19:01 UTC](https://meta.discourse.org/t/how-do-we-add-buttons-next-to-the-new-topic-button/112743/4 "2019-04-26T19:01:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
