View Helpers
includeLayout()
Signature
Section titled “Signature”includeLayout() — returns string
Available in: controller
Category: Miscellaneous Functions
Description
Section titled “Description”Includes the contents of another layout file. Typically used when a child layout wants to include a parent layout, or to nest layouts for consistent site structure.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | no | layout | Name of the layout file to include. |
Examples
Section titled “Examples”1. Make sure that the `sidebar` value is provided for the parent layout
<cfsavecontent variable="categoriesSidebar">
<cfoutput>
<ul>
#includePartial(categories)#
</ul>
</cfoutput>
</cfsavecontent>
contentFor(sidebar=categoriesSidebar);
// Include parent layout at `app/views/layout.cfm`
#includeLayout("/layout.cfm")#