<p>Although you couldn't necessarily change the _layout template with the method given in that tutorial. What you could do is include the header 
the templates rather than in the _layout.html for each template and change it out with another header in the other specific URLs. Or hide it, or whatever you like. </p>

CC BY-SA 3.0
2015-12-03T17:00:31.297Z
2015-12-03T17:00:31.297Z
George Dunning
<p>I've followed this <a href="https://designbycosmic.com/journal/craft-cms-ajax-page-transitions-with-history-pushstate" rel="nofollow">tutorial</a> by Zack Spear. It leaves your website with a header and footer that stay constant while the body of the page is loaded in through AJAX when you change pages.</p>

<p>Is it possible to have different _layout templates used for different pages with this approach or can it only be one? Could I hide the header on certain URLs? Could I show a secondary menu on specific urls?</p>

<templating><ajax><layout>
Is it possible to load different "_layouts" with ajax for certain pages?
# Is it possible to load different "_layouts" with ajax for certain pages?

(Asked by: username_0 on 2015-12-03)

I've followed this [tutorial](https://designbycosmic.com/journal/craft-cms-ajax-page-transitions-with-history-pushstate) by Zack Spear. It leaves your website with a header and footer that stay constant while the body of the page is loaded in through AJAX when you change pages.

Is it possible to have different \_layout templates used for different pages with this approach or can it only be one? Could I hide the header on certain URLs? Could I show a secondary menu on specific urls?

**Tags:** templating, ajax, layout


---

## 1 answers

### Answer by username_1 on 2015-12-03. Score: 1

Although you couldn't necessarily change the \_layout template with the method given in that tutorial. What you could do is include the header
the templates rather than in the \_layout.html for each template and change it out with another header in the other specific URLs. Or hide it, or whatever you like.


---

