Adding tags to topics created with Discourse Embed feature?

Is it possible to add tags to topics that are created with the Discourse embed feature to embed comments on other pages?

We want to embed Discourse in different areas of our documentation, and depending on the area that it is embedded, add different tags to those topics.

If it matters (or if anyone has any other thoughts on this), this would be done in an MKDocs site.


What is an “area?” The embed setup posted topics in a single category.

Discourse Automation Plugin might help? It has a script to add a tag, so maybe it can help. Or maybe you’d need to do something with the API to move the topics, or have a plugin that used add_model_callback(Topic, :after_create) to identify the new topics from your site and re-tagged them.

1 Like

Great clarifying question!

So it would be one embed for all documentation pages, but embeds in different docs would, ideally, have different tags. For example, the following docs structure:

  • /docs (discourse category: #docs-feedback, tag: docs)
    • /docs/doc1 (discourse category: #docs-feedback, tag: #doc1)
      • /docs/doc1/item1 (discourse category: #docs-feedback, tag: #doc1)
      • /docs/doc1/item2 (discourse category: #docs-feedback, tag: #doc1)
    • /docs/doc2 (discourse category: #docs-feedback, tag: #doc2)
      • /docs/doc2/item1 (discourse category: #docs-feedback, tag: #doc2)
      • /docs/doc2/item2 (discourse category: #docs-feedback, tag: #doc2)

I think I understand. If you want them tagged, you’d need to do that with the automation plugin or a custom plugin as I suggested before. I guess you’d get the tag by parsing the URL of the place it’s embedded.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.