# Replacing Details Toolbar Button?

**URL:** https://meta.discourse.org/t/replacing-details-toolbar-button/102101
**Category:** Development
**Created:** [November 15, 2018, 12:01pm UTC](https://meta.discourse.org/t/replacing-details-toolbar-button/102101 "2018-11-15T12:01:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Kankuro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kankuro/32/123065_2.png) [@Kankuro](https://meta.discourse.org/u/Kankuro)
#### Post date: [November 15, 2018, 12:01pm UTC](https://meta.discourse.org/t/replacing-details-toolbar-button/102101/1 "2018-11-15T12:01:44Z")

</div>

Hello,

I’m trying to replace the existing details toolbar button with my own custom one, but I’m not having much success. I was following [this tutorial about the plugin API](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648/1#heading--4-c-13) along with my existing knowledge about JS but nothing seemed to be working.  
I even copied the exact code from that example and pasted it in the theme editor under the `</body> ` tab but even the heart icon didn’t appear. I’m not sure if an update made that tutorial inaccurate or what, but any help would be greatly appreciated.

  

**What I’m trying to accomplish:**

- Replace the existing details with a new button that is titled “Insert Spoiler”
- When clicked a modal will appear that has two input fields, one for the title and one for the contents.
- Instead of using the markup, I want to use HTML to avoid issues with videos not embedding as [mentioned here](https://meta.discourse.org/t/embed-youtube-video-into-details-summary-tag/95166).

  

**Final Output:**

```html
<details>
<summary>value_from_title_input</summary>
Value_From_Contents_Input
</details>

```

  

_Note: If a modal would be a lot of work, I can settle with placeholder text being inserted instead such as “Spoiler Title” for the title and “Contents” for the contents._
