Discourse Preset Topic Composer

:discourse2: Summary Add presets to your new topic button
:hammer_and_wrench: Repository Link GitHub - discourse/discourse-preset-topic-composer: preset composer
:open_book: Install Guide How to install plugins in Discourse

Features

It adds presets to new topic button.

Here are a few images of the plugin in action:

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.

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

When published, it looks like this:

Configuration

This plugin uses json_schema to configure it.

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

general configs:

tag group config:

tag_group can be the name of any tag group

CHANGELOG

  • Init!
  • Added a highlight when in URL feature that follows this pattern 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
10 Likes

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.

2 Likes

Yes!! Exactly!

1 Like

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

I love this feature!

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

2 Likes

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.

2 Likes

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

1 Like

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


1 Like

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?

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.

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.

1 Like

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.

:beers: :sunglasses: :+1:

1 Like