Prefilled composer link generator

:information_source: Summary Adds a button at the bottom of the editor that generates a link to a prefilled composer based on the current content
:eyeglasses: Preview Theme Creator
:hammer_and_wrench: Repository GitHub - moin-Jana/prefilled-composer-generator: Adds a button at the bottom of the editor that generates a link to a prefilled composer based on the current content
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

This theme component adds a button next to the close button in the composer that generates a link to a prefilled composer using the current content. The button is displayed when creating a new topic, personal message, or when editing the first post of a topic or message. Additionally, there is a setting that allows you to specify which groups will see the button.

Setting Description
restrict_to_groups Display the copy button only for members of the selected groups

For information on how to create topic and message links manually, see the documentation on Creating a link to start a new topic with pre-filled information and Creating pre-filled personal message links.

In addition to generating links for others, you can also use this button to convert your draft into a link. This serves as a workaround for the limitation of having only one draft at a time, allowing you to save and later continue working on your draft.

20 Likes

Nicely done! :star_struck: :discourse:

5 Likes

Pretty sweet awesome saves a lot of manual work

4 Likes

Hi @moin,
This component started receiving a deprecation notice due to these changes. Do you mind reviewing/approving the PR to update it?

3 Likes

Merged. I noticed adding tags to links is currently broken. Like a lot of other components, this one is also affected by the changes to tags which happened at the beginning of this year.

2 Likes

While this seemed to be an easy fix at first, it turned out to be a little more complicated. While the tags were an object as expected when you selected them in the composer (which was the change in core breaking the component), when you close and reopen the composer, the tags are still returned as strings instead of objects. A fix in core is already in progress, but in the meantime, the component can handle both objects and strings, so tags should be included in the links in all cases again.

3 Likes

This is a sweet little admin aid! Love it. And clever fix just now.

2 Likes