# How can I specify header/footer behavior based on a specific custom\_template

**URL:** <https://forum.ghost.org/t/how-can-i-specify-header-footer-behavior-based-on-a-specific-custom-template/15176>\
**Category:** Themes\
**Created:** [June 17, 2020, 7:24pm UTC](https://forum.ghost.org/t/how-can-i-specify-header-footer-behavior-based-on-a-specific-custom-template/15176 "2020-06-17T19:24:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![timfee](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/timfee/32/8489_2.png) [@timfee](https://forum.ghost.org/u/timfee)\
**Post date:** [June 17, 2020, 7:24pm UTC](https://forum.ghost.org/t/how-can-i-specify-header-footer-behavior-based-on-a-specific-custom-template/15176/1 "2020-06-17T19:24:34Z")

</div>

Hi there,

I’m trying to alter behavior of a header element based on whether a page is using a custom\_template from the dropdown, e.g. where `custom_template = 'custom-narrow-side-image'`.

There doesn’t seem to be a straightforward way to do this without a lot of hacky workarounds, so I’m assuming I’m missing something.

Is there a preferred way to specify this? e.g. apply classes to the navbar, hide/show content, etc.

---

<div class="post-metadata">

**Author:** ![timfee](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/timfee/32/8489_2.png) [@timfee](https://forum.ghost.org/u/timfee)\
**Post date:** [June 17, 2020, 8:35pm UTC](https://forum.ghost.org/t/how-can-i-specify-header-footer-behavior-based-on-a-specific-custom-template/15176/2 "2020-06-17T20:35:48Z")

</div>

FWIW,

```auto
{{#post}}
{{#has custom_template="custom-narrow-side-image"}}
hello
{{/has}}
{{custom_template}}
{{/post}}

```

produces:

```auto
custom-narrow-side-image

```

I’d expect it to produce

```nohighlight
hello
custom-narrow-side-image

```

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [June 18, 2020, 1:10pm UTC](https://forum.ghost.org/t/how-can-i-specify-header-footer-behavior-based-on-a-specific-custom-template/15176/3 "2020-06-18T13:10:18Z")

</div>

You’ve totally lost me with your approach! Where does this snippet live?

`{{#has}}` doesn’t have support for testing if you’re on a custom template, not seen anyone ask that before.

> **[Ghost Handlebars Theme Helpers: has](https://ghost.org/docs/themes/helpers/has/)**
>
> \#has allows theme developers to ask questions about the current context and provides more flexibility ⚡️ Read more about custom Ghost themes!

If you’re inside a custom template already then you know your content is being rendered with that template.

I’m guessing you’re trying to do something with partials? Can you share a more comprehensive example of what you’re doing?

---

<div class="post-metadata">

**Author:** ![timfee](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/timfee/32/8489_2.png) [@timfee](https://forum.ghost.org/u/timfee)\
**Post date:** [June 18, 2020, 2:16pm UTC](https://forum.ghost.org/t/how-can-i-specify-header-footer-behavior-based-on-a-specific-custom-template/15176/4 "2020-06-18T14:16:02Z")

</div>

Hi, sure!

I have some color classes I’m trying to apply in a shared navigation bar partial.

I’m able to use `#is` to toggle modes (e.g. light, dark, dim) based on whether it’s the index page, or content… but there are some content templates (e.g. full-screen stories) that I’d want to override.

Imagine that I want nav-light for home, nav-dark for posts, and nav-dim for posts that use `custom-narrow-side-image`.

My navigation bar is in a partial.

Ideally, I’d love `{{#is}}` to accept a template name in addition to a context, so I could

```auto
// navigation.hbs
// Ideal FUTURE hypothetical state
<nav class="nav {{#is "home"}} nav-light {{else}} {{#is "custom-narrow-side-image"}} nav-dim {{else}} nav-dark {{/is}} nav-dark {{/is}}">

```

But for now, I’m just looking for any way to furth

```auto
// navigation.hbs
// Current sticking point
<nav class="nav {{#is "home"}} nav-light {{else}} nav-dark {{/is}}">

```

There doesn’t seem to be any body\_class or post\_class that produces markup that contains `custom-narrow-side-image` – at least not when it’s loaded via the “global template” (post editor dropdown).

Sorry for not 'splaining better out of the gate 🙂

Tim
