Perch Tips: Layout Variables

Although we think of layouts as keeping things consistent between pages, sharing code across lots of different pages in your site, often pages have small differences between them.

You might use a Layout for the head of your document so that when you add a new CSS file it’s available on all pages, however you will want to ensure the page has a unique title. Perhaps some pages need some JavaScript or CSS that other pages don’t use and you want to be able to turn those on and off in the layout, but still share the majority of the code.

These little differences can be managed with Layout Variables.

In this video Drew demonstrates how to use Layout Variables to add a unique title to a page.


In the documentation you can find this video along with a transcript, and many other videos demonstrating aspects of using Perch.