<p>Try putting it inside of a simple block as the default value...</p>

<pre><code>{% block contactButton %}
    {% include '_contact-button' %}
{% endblock %}
</code></pre>

<p>Then on your one-off page, override that block with emptiness...</p>

<pre><code>{% block contactButton '' %}
</code></pre>

<p>Untested, but that should do the trick!</p>

CC BY-SA 3.0
2018-03-05T23:03:38.217Z
Ah I didn't realise you could override a block. That worked great. Thanks Lindsey!
patrick.altair
CC BY-SA 3.0
2018-03-05T22:30:18.480Z
2018-03-05T22:30:18.480Z
Lindsey D
<p>I have a _layout which includes a contact button:
<code>{% include '_contact-button' %}</code></p>

<p>This creates a small contact button in the bottom right of every page that when clicked expands into a contact form. I would like this to be on every page of the site except the Contact page as it has it's own contact form. Is there a way in the contact template to not include _contact-button while still using _layout? Something like <code>{% dontInclude '_contact-button' %}</code>?</p>

<templating><include><layout>
How to slightly alter _layout for one specific page?
# How to slightly alter _layout for one specific page?

(Asked by: username_0 on 2018-03-05)

I have a \_layout which includes a contact button:
`{% include '_contact-button' %}`

This creates a small contact button in the bottom right of every page that when clicked expands into a contact form. I would like this to be on every page of the site except the Contact page as it has it's own contact form. Is there a way in the contact template to not include \_contact-button while still using \_layout? Something like `{% dontInclude '_contact-button' %}`?

**Tags:** templating, include, layout


---

## 1 answers

### Answer by username_1 on 2018-03-05. Score: 2 | Accepted answer

Try putting it inside of a simple block as the default value...
{% block contactButton %}
    {% include '_contact-button' %}
{% endblock %}

Then on your one-off page, override that block with emptiness...
{% block contactButton '' %}

Untested, but that should do the trick!

> **Comments:**
> **username_0**: Ah I didn't realise you could override a block. That worked great. Thanks Lindsey!  

---

