---
schema_version: "1"
id: b49f95d6e6e10ef0432de358f4f98d0cc1ca018e5bbbae622396af86f8058d81
title: apex:insert
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-insert.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-compref-insert.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 320265932f66fbf55bdf125c5fe1856a6c14cf939a0f7821cd83982bf3d13485
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# apex:insert

A template component that declares a named area that must be defined by an `<apex:define>` component in another Visualforce page. Use this component with the `<apex:composition>` and `<apex:define>` components to share data between multiple pages.

## Example

```apex
<!-- 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:

```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
```

## Attributes

|Attribute Name|Attribute Type|Description|Required?|API Version|Access|
|--------------|--------------|-----------|---------|-----------|------|
|`name`|String|The name of the matching define tag that provides the content to be inserted into this Visualforce page.|Yes|10.0|global|

**See Also**  


-   [apex:composition](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-compref-composition.md)
-   [apex:define](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-compref-define.md)

