1. Page header and footer

First, we move code that our page templates use more than once into templates of its own: the page header including the navigation, and the page footer.

In the area “Page templates”, create the following two templates:

Name: header
Code:

<html>
<body>
<div>Camindo Architects</div>
<hr>
(CMS:SELECT navigation
  filter[area]=pages
  sort="lft asc"
)
<hr>

Name: footer
Code:

</body>
</html>

Then, in the templates page_default and page_projects, replace the corresponding parts of the code with (CMS:INCLUDE header) and (CMS:INCLUDE footer).

The template page_default then looks like this:

(CMS:INCLUDE header)
<h1>(CMS:TEXT title)</h1>
(CMS:MEDIA image
  attr[style]="width:400px;height:auto;float:left;margin-right:20px;"
)
(CMS:TEXT text)
<br style="clear:both">

(CMS:SELECT list_subpages
  filter[parent_id]="$cms[record_id]"
  sort="position ASC"
)
(CMS:INCLUDE footer)