# Topic Template Placeholder Text theme component

**URL:** https://meta.discourse.org/t/topic-template-placeholder-text-theme-component/149053
**Category:** Theme component
**Created:** [April 23, 2020, 7:20pm UTC](https://meta.discourse.org/t/topic-template-placeholder-text-theme-component/149053 "2020-04-23T19:20:00Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [April 24, 2020, 1:14pm UTC](https://meta.discourse.org/t/topic-template-placeholder-text-theme-component/149053/3 "2020-04-24T13:14:50Z")

</div>

You can try something like this

```markdown
<script type="text/discourse-plugin" version="0.8">
  api.modifyClass("model:composer", {
    applyTopicTemplate() {
      this._super(...arguments);

      Ember.run.schedule("afterRender", () => {
        // do your work here
      });
    }
  });
</script>

```

This should allow you to add some custom logic when Discourse applies category topic templates.

That said, this type of way of writing stuff is a bit outdated. I would also recommend that you give this a read if you plan to spend a lot time on Discourse themes. It makes life much easier.

> [@Split up theme Javascript into multiple files](https://meta.discourse.org/t/splitting-up-theme-javascript-into-multiple-files/119369):
>
> Complex theme javascript can be split into multiple files, to keep things nicely organised. To use this functionality, simply add files to the /javascripts folder in your theme directory. These files can not be edited from the Discourse UI, so you must use the [Theme CLI](https://meta.discourse.org/t/discourse-theme-cli-console-app-to-help-you-build-themes/82950) or [source the theme from git](https://meta.discourse.org/t/how-to-source-a-theme-from-a-private-git-repository/82584). Javascript files are treated exactly the same as they are in core/plugins, so you should follow the same file/folder structure. Theme files are loaded after core/plugins, so if the filenames match,…

---

_[View the full topic](https://meta.discourse.org/t/topic-template-placeholder-text-theme-component/149053)._
