# Getting Topic Information

**URL:** <https://meta.discourse.org/t/getting-topic-information/126269>\
**Category:** Development\
**Created:** [August 20, 2019, 11:12am UTC](https://meta.discourse.org/t/getting-topic-information/126269 "2019-08-20T11:12:37Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![sfoster](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sfoster](https://meta.discourse.org/u/sfoster)\
**Post date:** [August 23, 2019, 12:05pm UTC](https://meta.discourse.org/t/getting-topic-information/126269/3 "2019-08-23T12:05:43Z")

</div>

So what we were trying to accomplish is that we have certain HTML messages that we want to show sitewide, but instead of entering them individually on every topic, we wanted to just show them automatically depending on a topic tag. What we decided to do is to simply store the messages and tags in the setting and used a widget to target the tags on the individual topics based on the discourse container. Is the correct way to go about this? So something like this:

```plaintext
 const container = Discourse. __container__ ;
 const topicController = container.lookup("controller:topic");
 tags = topicController.get("target.currentRoute.parent.attributes.tags");

```

Then just compare the tags on the topic to those stored in the settings and display HTML or not based on the comparsion

---

_[View the full topic](https://meta.discourse.org/t/getting-topic-information/126269)._
