Install this theme component
My reusable content
- [ ] task 1
- [ ] task 2
Note that if user is not logged in, clicking the button will display the login modal.
key is mandatory
action="create" this will make the button open a composer to create a new topic
action="create_pm" this will make the button open a composer to create a new PM
categoryId="2" only usable with
action="create", will set the category of the opened composer
You can have special keys in your template which will get replaced:
- $week_start → date at the beginning of the week
- $week_end → date at the end of the week
- $prev_week_start → date at the start of previous week
- $prev_week_end → date at the end of previous week
Note that this will be replace by local dates.
tagsList=":heart:,foo,#bar" will show a least of checkboxes at the end of the template so people can tag their post easily.
I was wondering can this be used in a specific category/sub?
Ie bug reporting form?
[wrap=template key="bug-report" action="create" categoryId="your-bug-category-id"]
Thank you will need to explore this more.
This is the best. Thank you!! I use this to create checklist templates that can be created anytime we’re doing a repetitive project. Before, our instructions would have been “copy and paste everything below” instead of having this very elegant button to create a topic for people.
Is there a plan to make this functionality accessible in the composer window? To me the most logical place being where things like Hide Details and Build Poll live.
I just updated the component, see OP for usage but a quick note:
- placeholder dates are now replaced by local dates
- you can now define a tagsList
Thank you for a great component!
It’s impossible to add a poll in the wrap. Can you add this functionality?
[poll type=regular results=on_vote chartType=bar]
# Who will join?
I added more locales to your component and created a PR. Please, check.
How can i install this component?
In my opinion it’d be more helpful to have an example for the reply case (without action=create) because this is probably the reason, the majority is searching for since creating a topic is already possible via URL
Would it be possible to use a template to create a new personal message?
Also, when someone is not signed in, clicking on “Use template as reply” does not result in any action. Could you add functionality where if a user is not logged in, something happens to nudge them to log in or create a new account?
Great suggestion, it’s done, I updated the OP.
Is there a way to pre-populate the title of a new topic?
Is there a way to automatically add tags instead of having just the tag list?
No, but that’s reasonable feature request for sure. I’m kinda full ATM but making a note of this, thanks.
Is there any possible way to modify the stock reply button in a topic with such a template?
That would be a gamechanger for specific structured conversations in the forum. Especially for contests etc where users have to submit content in a structured manner.
Hi, sorry I don’t understand your request, can you be more specific please ?
Currently the user can access the reply template only via the button in the first post generated by the theme component.
What I would like to achieve is to enable the template for the stock reply buttons in the topic as well (reply button below the timeline and reply button below the last post)
Edit: One prolific use case is a topic where users can leave feedback like bug reports etc. If we could add per-topic post templates just like for per-category templates for new topics, that would lead to less incomplete reports and hence save our staff a lot of time.
I am having some trouble installing this component. I’m new to Discourse so hoping someone can confirm if the steps I’ve taken are correct.
I followed the guide here How do I install a Theme or Theme Component? to install the component. I’ve included the component on all of our themes.
However, when I create a new topic and include
There is no button for “Use template as reply”. Example:
It just shows the wrapper around the template. Am I missing a step here? Is there something I need to customise in the code?
Also, Discourse is saying the theme has errors either in CSS, HTML or YAML. I’m not sure if that has something to do with why the button doesn’t display?
Thanks for any help.
Will have a look tomorrow
Thanks. I’ve been informed it may also be an issue with the version of Discourse we’re running but will come back on that.