# Discourse Preset Topic Composer

**URL:** https://meta.discourse.org/t/discourse-preset-topic-composer/311174
**Category:** Plugin
**Tags:** experimental
**Created:** [June 7, 2024, 6:47pm UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174 "2024-06-07T18:47:15Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![gabriel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gabriel/32/367911_2.png) [@gabriel](https://meta.discourse.org/u/gabriel)
#### Post date: [June 7, 2024, 6:47pm UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/1 "2024-06-07T18:47:15Z")

</div>

| | | |
| --- | --- | --- |
| :discourse2: | **Summary** | Add presets to your new topic button |
| 🛠 | **Repository Link** | [GitHub - discourse/discourse-preset-topic-composer: preset composer · GitHub](https://github.com/discourse/discourse-preset-topic-composer) |
| 📖 | **Install Guide** | [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157) |

  

### Features

It adds presets to `new topic` button.

Here are a few images of the plugin in action:

 ![Screenshot 2024-06-07 at 15.07.09](https://global.discourse-cdn.com/meta/original/4X/7/9/e/79e4698b76852a15dd0456affa8c0b2b66440ac6.png)

The `new topic` button has two presets in this example: `new question` and `new event`

I’ve selected `new question` for this example; it has a `tag_group` to be selected, and it was added in the composer without the user having to select the `bug` tag.

 ![Screenshot 2024-06-07 at 15.07.45](https://global.discourse-cdn.com/meta/original/4X/a/8/2/a82eb744002767a46597dd5740f0f8d5ca61b5f9.png)

If I try to publish this topic without selecting the `tag_group` it will flag that I must fill out the required fields.

 ![Screenshot 2024-06-07 at 15.08.03](https://global.discourse-cdn.com/meta/original/4X/0/f/b/0fb817cccea14f38bf8d1b237b87f55c3815ecaf.png)

When published, it looks like this:

 ![Screenshot 2024-06-07 at 15.29.17](https://global.discourse-cdn.com/meta/original/4X/6/7/7/677c1dba2c41fb943e0d7146a735df6bed1760b9.png)

### Configuration

This plugin uses `json_schema` to configure it.

Here is a print of how I made `new question` button.

_general configs_:

 ![Screenshot 2024-06-07 at 15.42.54](https://global.discourse-cdn.com/meta/original/4X/2/f/e/2fe7ea824b17ea857626aacc4403a94f9e078769.png)

_tag group config_:

 ![Screenshot 2024-06-07 at 15.43.01](https://global.discourse-cdn.com/meta/original/4X/2/9/7/29793655bf7b6cd2f69fdc4a871e9849268661d8.png)

> tag\_group can be the name of any tag group

### CHANGELOG

- Init!
- Added a highlight when in URL feature that follows [this pattern](https://github.com/discourse/discourse-preset-topic-composer/blob/b03a7c10bffec0f2c704a2433770eb0bb794ac45/assets/javascripts/discourse/services/dropdown-buttons.js#L35-L38) to highlight the button
  - it also highlights the dropdown button when it is in the same `categoryId` as defined in the settings.

### TODO

- the composer does not behave the same when editing. Maybe this is a feature for the future

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [June 8, 2024, 5:06am UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/2 "2024-06-08T05:06:59Z")

</div>

An interesting idea. Could this be made to work with form-templates?

Ie based on template chosen for topic it automatically adds a Tag?

Definitely can see this & form-templates could be a good pairing.

---

<div class="post-metadata">

### Author: ![gabriel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gabriel/32/367911_2.png) [@gabriel](https://meta.discourse.org/u/gabriel)
#### Post date: [June 10, 2024, 1:56pm UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/3 "2024-06-10T13:56:37Z")

</div>

> [@Heliosurge](#):
>
> Ie based on template chosen for topic it automatically adds a Tag?

Yes!! Exactly!

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [June 10, 2024, 3:30pm UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/4 "2024-06-10T15:30:48Z")

</div>

How do we target a template-form selected to automatically assign tag?

---

<div class="post-metadata">

### Author: ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)
#### Post date: [June 12, 2024, 2:55am UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/5 "2024-06-12T02:55:28Z")

</div>

I love this feature!

I would also like a setting to position this button in the site header!

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [July 24, 2024, 1:08pm UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/6 "2024-07-24T13:08:37Z")

</div>

Has anyone tested it with Custom Wizard plugin yet? We have a troubleshooting category in which we require a CW to be filled out to create a new topic.

---

<div class="post-metadata">

### Author: ![Mr.X\_Mr.X](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mr.x_mr.x/32/126610_2.png) [@Mr.X\_Mr.X](https://meta.discourse.org/u/Mr.X_Mr.X)
#### Post date: [July 24, 2024, 5:58pm UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/7 "2024-07-24T17:58:17Z")

</div>

This would be fantastic to be coupled with this plug-in. Did anyone manage to have it working?

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [July 25, 2024, 3:53am UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/8 "2024-07-25T03:53:32Z")

</div>

I asked a similar question regarding the link below. However I suspect my post was not clear enough

> [@Introducing Form Templates](https://meta.discourse.org/t/introducing-experimental-form-templates/278631):
>
> star This feature is no longer experimental! Go here to learn more about the feature and how to use it in your community: [Creating form templates](https://meta.discourse.org/t/creating-form-templates/397564) Hello, Discourse Meta Community! We are excited to introduce a new experimental feature, form templates. With it, you can enforce a structured form with data validation as part of the topic creation flow. [multiple\_form\_templates] Enabling the feature The feature is hidden behind a site-wide experimental flag. To enable it, just turn on the exp…

* * *

> [@gabriel](#):
>
> > [@Heliosurge](#):
> >
> > Ie based on template chosen for topic it automatically adds a Tag?
> 
> Yes!! Exactly

> [@Heliosurge](#):
>
> How do we target a template-form selected to automatically assign tag?

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [July 25, 2024, 11:45am UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/9 "2024-07-25T11:45:31Z")

</div>

For our use case, we are mostly intrigued by the dropdown button feature.

For us it would be already sufficient to simply modify the “New Topic” button with multiple dropdown items and assign hyperlinks to each.

But I reckon, a theme component might achieve something like that, right?

---

<div class="post-metadata">

### Author: ![gabriel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gabriel/32/367911_2.png) [@gabriel](https://meta.discourse.org/u/gabriel)
#### Post date: [July 25, 2024, 1:06pm UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/10 "2024-07-25T13:06:25Z")

</div>

I did not know that this was a feature!

I did it from scratch and using the composer. I have not thought/tested how it would work with template form.

> [@jrgong](#):
>
> theme component might achieve something like that, right?

If the dropdown links are based on a configuration made by an admin and no backend is required(getting some data from somewhere). I think you can get this done by a TC.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [July 25, 2024, 2:18pm UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/11 "2024-07-25T14:18:23Z")

</div>

> [@gabriel](#):
>
> I did not know that this was a feature!
> 
> I did it from scratch and using the composer. I have not thought/tested how it would work with template form.

My apologies for not ensuring my query was not precise. With you being part of the discourse team; I had mistakingly thought/presumed you were aware of this fairly new feature added. I should have linked the feature announcement to ensure my query had proper clarity.

I will try to ensure I do not make this kind of error in future.

🍻 🕶 👍

---

<div class="post-metadata">

### Author: ![Tealk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tealk/32/525923_2.png) [@Tealk](https://meta.discourse.org/u/Tealk)
#### Post date: [September 20, 2024, 9:48am UTC](https://meta.discourse.org/t/discourse-preset-topic-composer/311174/12 "2024-09-20T09:48:32Z")

</div>

Hello, because I was introduced to the plugin [here](https://meta.discourse.org/t/easy-tag-selection-when-creating-posts/327149/4), can I use it to create multiple fields for tag groups?

//Edit  
Ok so far it seems to cover that, currently it doesn’t seem to be possible to limit or exclude the buttons to a few specific categories?

 ![The image displays a computer screen with a webpage open, showing a search function with results. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/c/2/2/c22c73efba3ec661627a6ffca508d7cad9e8242c.png)
