Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
apex:include
A component that inserts a second Visualforce page into the current page. The entire page subtree is injected into the Visualforce DOM at the point of reference and the scope of the included page is maintained.
If content should be stripped from the included page, use the <apex:composition> component instead.
Example
1<!-- Page: -->
2<apex:page id="thePage">
3 <apex:outputText value="(page) This is the page."/><br/>
4 <apex:include pageName="include"/>
5</apex:page>
6
7<!-- Page: include -->
8<apex:page id="theIncludedPage">
9 <apex:outputText value="(include) This is text from another page."/>
10</apex:page>The example above renders the following HTML:
1(page) This is the page.<br/>
2<span id="thePage:include">(include) This is text from another page.</span>Attributes
| Attribute Name | Attribute Type | Description | Required? | API Version | Access |
|---|---|---|---|---|---|
| id | String | An identifier that allows the inserted page to be referenced by other components in the page. | 10.0 | global | |
| pageName | ApexPages.PageReference | The Visualforce page whose content should be inserted into the current page. For this value, specify the name of the Visualforce page or use merge-field syntax to reference a page or PageReference. | Yes | 10.0 | global |
| rendered | Boolean | A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. | 10.0 | global |