# How to verify if I am on a custom page?

**URL:** <https://forum.ghost.org/t/how-to-verify-if-i-am-on-a-custom-page/13898>\
**Category:** Developer help\
**Created:** [April 27, 2020, 6:33pm UTC](https://forum.ghost.org/t/how-to-verify-if-i-am-on-a-custom-page/13898 "2020-04-27T18:33:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![filijs](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/filijs/32/12115_2.png) [@filijs](https://forum.ghost.org/u/filijs)\
**Post date:** [April 27, 2020, 6:33pm UTC](https://forum.ghost.org/t/how-to-verify-if-i-am-on-a-custom-page/13898/1 "2020-04-27T18:33:31Z")

</div>

Hello, good day to everyone.

I wanted to see if anyone could support me with their Ghost experience on whether what I’m doing is okay or if there is a better way to do it.

Currently all my templates take `default.hbs` as a reference to build. In this file I check what type of page it is on, in order to load the correct assets.

```auto
{{#is "bits"}}
    <link rel='stylesheet' href='{{asset "styles/bit-bundle.css"}}'>
{{/is}}

{{#is "videos"}}
    <link rel='stylesheet' href='{{asset "styles/video-bundle.css"}}'>
{{/is}}
...

```

I ran into the problem that I have `post.hbs` and also `custom-post-name.hbs` in which I want to load other types of scripts, that’s why I did the following:

```auto
{{#is "post"}}
   {{#post}}
       {{#has tag="blog"}}
            <link rel='stylesheet' href='{{asset "styles/post-bundle.css"}}'>
        {{/has}}
        {{#has tag="bit"}}
            <link rel='stylesheet' href='{{asset "styles/postBit-bundle.css"}}'>
        {{/has}}
    {{/post}}
{{/is}}

```

Is there a better way to do this? Maybe something like `{{#has custom-post-name}}` or would it be better to create another `default-custom-post.hbs` file?

Thank you in advance for your comments.

---

<div class="post-metadata">

**Author:** ![GBJsolution](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/gbjsolution/32/4738_2.png) [@GBJsolution](https://forum.ghost.org/u/GBJsolution)\
**Post date:** [April 27, 2020, 7:19pm UTC](https://forum.ghost.org/t/how-to-verify-if-i-am-on-a-custom-page/13898/2 "2020-04-27T19:19:01Z")

</div>

Hi, I have just answered similar type of question, Actually honestly I did not clearly understand. Also there is some non English ( probably Spanish ) in your question.

Is “bits” and “videos” in first comment block are post collections? Are those collections are made via route based on tags? are those collections are using custom template?

Anyways you can try and play with `{{{block}}}` and `{{contentFor}}` heplers. Maybe these can help you. See this thread for better understanding how they works.

> [@Code injection into custom template using handlebars](https://forum.ghost.org/t/code-injection-into-custom-template-using-handlebars/13895/3):
>
> Hi you can do that, I have not done it but there is similar thing already in default casper theme. In casper’s default.hbs file near the bottom you will see following code with comment. don’t miss the triple curly braces. {{!-- The #block helper will pull in data from the #contentFor other template files. In this case, there's some JavaScript which we only want to use in post.hbs, but it needs to be included down here, after jQuery has already loaded. --}} {{{block "scripts"}}} Then see post…

---

<div class="post-metadata">

**Author:** ![DavidDarnes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daviddarnes/32/3533_2.png) [@DavidDarnes](https://forum.ghost.org/u/DavidDarnes)\
**Post date:** [April 28, 2020, 3:43pm UTC](https://forum.ghost.org/t/how-to-verify-if-i-am-on-a-custom-page/13898/3 "2020-04-28T15:43:35Z")

</div>

Content block helpers are a good solution, you could dictate the CSS file loaded within that template file, rather than conditionally applying them from another file.
