Perch Tips: Using Layouts
Perch gives you a lot of flexibility when creating your pages. You don’t need to create a theme, you can essentially have a static HTML page and drop a few Perch Regions into it to start editing.
However most sites have some elements that are common to many pages. It makes sense to turn these into includes as then you can make a change in one place and see it reflected on every page that includes the file.
As you are using PHP with Perch you can just use PHP includes, however Perch has the Perch Layouts functionality, which gives you some extra features over just using PHP includes.
- layout variables
- progressive flushing
- better organization of code and variables
- as we control layouts any additional functionality we add can be taken advantage of
In this video Drew demonstrates how to turn a page into one using layouts.
In the documentation you can find this video along with a transcript, and many other videos demonstrating aspects of using Perch.