Topic List Item footer buttons - timeline content

The way that I’ve dealt with this in the past is by packaging the buttons in a html helper, which will render the raw html in the raw templates, which you can then insert via a raw plugin outlet. Here’s an example:

https://github.com/paviliondev/discourse-topic-previews/blob/master/assets/javascripts/discourse/helpers/preview-helpers.js.es6#L8

The button click is handled in the topic-list-item component, e.g.

https://github.com/paviliondev/discourse-topic-previews/blob/master/assets/javascripts/discourse/initializers/preview-edits.js.es6#L332

@merefield May also have some thoughts :slight_smile:


Also, you’ll probably want to use the theme javascripts folder structure instead of adding scripts to the header.html. See

4 Likes