---
schema_version: "1"
id: 4f6716eaa73e6f8e5f1d8885ccaf3b10b1f47c6d3411c4aaca55ebf085efc779
title: apex:include
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/components/pages-compref-include.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-compref-include.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 84c4420354b25a9b414bda77ce74a1edecb8032be8dbdec178c6ea62b0bf465f
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# 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

```apex
<!-- Page: -->
<apex:page id="thePage">
	<apex:outputText value="(page) This is the page."/><br/>
	<apex:include pageName="include"/>
</apex:page>

<!-- Page: include -->
<apex:page id="theIncludedPage">
	<apex:outputText value="(include) This is text from another page."/>
</apex:page>
```

The example above renders the following HTML:

```html
(page) This is the page.<br />
<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 |

**See Also**

- [Referencing an Existing Page with \<apex\:include>](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/templates/pages-templates-include.md)
