Skip to content

Instantly share code, notes, and snippets.

@robmcalister
Created June 11, 2014 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robmcalister/248c531e69a38c457d2e to your computer and use it in GitHub Desktop.
Save robmcalister/248c531e69a38c457d2e to your computer and use it in GitHub Desktop.
<!-- Page: composition -->
<!-- This page acts as the template. Create it first, then the page below. -->
<apex:page>
<apex:outputText value="(template) This is before the header"/><br/>
<apex:insert name="header"/><br/>
<apex:outputText value="(template) This is between the header and body"/><br/>
<apex:insert name="body"/> </apex:page>
<!-- Page: page -->
<apex:page>
<apex:composition template="composition">
<apex:define name="header">(page) This is the header of mypage</apex:define>
<apex:define name="body">(page) This is the body of mypage</apex:define>
</apex:composition>
</apex:page>
The example above renders the following HTML:
(template) This is before the header<br/>
(page) This is the header of mypage<br/>
(template) This is between the header and body<br/>
(page) This is the body of mypage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment