Rotating Composer Placeholder

:discourse2: Summary Rotating Composer Placeholder adds dynamic, rotating placeholder text to the Discourse composer, showing a different prompt each time the composer is opened.
:hammer_and_wrench: Repository Link https://github.com/Ethsim12/discourse-rotating-composer-placeholder
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Features

  • Rotates the composer placeholder text each time the composer opens
  • Works for:
    • replies
    • new topic composer
  • Fully configurable via theme component settings
  • No plugin required
  • Client-side only (safe and lightweight)
  • Uses modern api-initializers

Install

  1. In Discourse Admin, go to:
    Admin → Appearance → Themes & components → Components → 3 dots

  2. Click Install.

  3. Choose From a git repository.

  4. Paste this repository URL and click Install.

Enable the theme component

Installing a theme component does not activate it automatically.
You must attach it to a theme.

  1. Go to:
    Admin → Appearance → Themes & components → Components → Rotating Composer Placeholder

  2. Click your active theme
    (for example: “Default”, “Desktop”, or your custom theme).

  3. Press the green tick box.

  4. Refresh your browser.

Once enabled, the component will immediately apply to that theme.

Configure the component

  1. Still within the theme component’s page.

  2. Edit the rotating_placeholders list.

Example values:

  • What did you try? Include steps to reproduce.
  • One idea per reply. If it’s a new issue, start a new topic.
  • Please include: expected result, actual result, and any errors.
  • Tip: paste logs inside ```triple backticks```.

Notes:

  • Each list entry becomes a possible placeholder.
  • Empty entries are ignored.
  • If the list is empty, a default placeholder is used.

Known limitations

  • UI-only enhancement
  • Does not affect post content
  • Placeholder rotates when the composer opens
  • Future composer refactors may require minor selector updates

Compatibility

  • Designed for modern Discourse versions
  • Recommended minimum: Discourse 3.2+
  • Uses supported theme APIs only
4 Likes

Can you share examples of use case?

1 Like

I think the examples do a good job demonstrating the use case. There are lots of things to consider when composing a message. If you put just one, it’ll soon be ignored. If you put all of those, no one would read any of them. Having a different one each time increases the likelihood that someone might read and consider one of them.

You could also put funny Easter eggs.

4 Likes

Oh , right, I didn’t even see the examples.

Game of Thrones: The Walk of Shame

3 Likes

Thanks! One nice bonus I found is that the component works cleanly with the rich text composer as well - the placeholder still rotates correctly there.

Since it hooks into the composer lifecycle rather than editor-specific internals, it doesn’t rely on Markdown-only selectors, which helps keep it compatible across composer modes.

If Discourse refactors the editor again in future, this should hopefully keep the surface area for breakage fairly small.

1 Like

nicely done @Ethsim2 :clap:

Perhaps category specific placeholders could be a useful addition? (although I sort of recall there may be a component somewhere that already does that feature)

I actually want to use this to make them ALL funny on one of my forums…

“WHAT IS WRONG WITH YOU? CAN’T YOU READ???”
“What’s the difference between someone who doesn’t search before posting and a lazy arse?”
"If you are reporting a bug, please first make sure it is not an arachnid. "
“What is the airspeed velocity of an unladen swallow?”

5 Likes

You’re welcome! :slightly_smiling_face:

Category-specific placeholders is a really nice idea - I can see it being especially useful for “Support / Bug” vs “General chat” categories, where the prompts you want users to see are completely different.

Implementation-wise, the composer context usually provides enough signal to do this cleanly:

• New topic: key off the selected categoryId in the composer model

• Reply: derive the category from the topic context

So a possible v1 could look like:

• a theme setting mapping category_id → placeholder list

• fallback to the global rotating_placeholders if no category match is found

If you remember the existing component you’re thinking of, I’d love a link - otherwise I’m happy to add this here as a feature request and gauge interest (and avoid duplicating work if it already exists).

Also - your “ALL funny” list is exactly the kind of chaotic good I had in mind :joy:

(I’d probably still mix in a few serious ones, so the occasional useful reminder sneaks through!)

There is Topic Template Placeholder Text theme component where you can use the category template as the placeholder

2 Likes

Thanks! That’s a really helpful link.

That component (“Topic Template Placeholder Text”) is slightly different to what this one is doing: it uses the category topic template as the placeholder (so the placeholder is category-specific, but it’s essentially the template content).

This theme component rotates through a list of short prompts each time the composer opens (and it applies to replies as well as new topics). So “category-specific placeholders” could still be a useful addition here if we want rotating per-category lists with a fallback to the global list - especially for “Support/Bug” vs “General chat”.

But if someone’s goal is specifically “show my category template as placeholder”, that other TC already solves it nicely.