# Category specific Disclaimer

**URL:** https://meta.discourse.org/t/category-specific-disclaimer/263168
**Category:** Development
**Created:** [April 28, 2023, 10:24am UTC](https://meta.discourse.org/t/category-specific-disclaimer/263168 "2023-04-28T10:24:35Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 28, 2023, 12:27pm UTC](https://meta.discourse.org/t/category-specific-disclaimer/263168/3 "2023-04-28T12:27:58Z")

</div>

Hi, welcome back!

If you see blank, it’s because you have an error. `find` doesn’t exist in the `helper`.  
You can usually see that in the browser console (F12).

You probably want something like that:

```js
api.decorateWidget('post:before', (helper, args) => {
    if (helper.widget.model.topic.category_id === 51) {
        return helper.h("div.disclaimer", settings.MY_DISCLAIMER)
    }
});

```

or using raw HTML:

```js
const RawHtml = require("discourse/widgets/raw-html").default;

api.decorateWidget('post:before', (helper, args) => {
    if (helper.widget.model.topic.category_id === 51) {
         return new RawHtml({html: `<div class="container">${settings.MY_DISCLAIMER}</div>`})
    }
});

```

You can read [this post](https://meta.discourse.org/t/how-to-add-customer-html-after-post-1/123068/2) explaining how this `h` helper works.

You can do the following if you want to add some HTML before the cooked content:

```js
api.decorateWidget('post-contents:before', (helper, args) => {
    const { topic } = helper.widget.findAncestorModel();

    if (topic && topic.category_id === 51) {
         return helper.h("div.disclaimer", settings.MY_DISCLAIMER);
    }
});

```

---

_[View the full topic](https://meta.discourse.org/t/category-specific-disclaimer/263168)._
