Creating a website template

In the previous recipes in this chapter, each page contained the entire Visualforce markup needed to display its content. This leads to repetition of common markup, to display headers and footers for example. In the event that the header or footer content needs to be changed, every page on a site needs to be updated with the new markup.

Visualforce provides a solution to this issue-templates. These allow the common elements of a site to be added to a template that is used as the starting point for rendering any page. The page then injects its specific content into the template at appropriate points.

In this recipe we will create a template version of the SiteItem Visualforce page from the Retrieving content from Salesforce ...

Get Visualforce Development Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.