Miscellaneous
includeLayout()
Signature
Section titled “Signature”includeLayout() — returns any
Description
Section titled “Description”Includes the contents of another layout file. This is usually used to include a parent layout from within a child layout.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | layout | Name of the layout file to include. |
Examples
Section titled “Examples”<!--- Make sure that the `sidebar` value is provided for the parent layout --->
<cfsavecontent variable="categoriesSidebar">
<cfoutput>
<ul>
##includePartial(categories)##
</ul>
</cfoutput>
</cfsavecontent>
<cfset contentFor(sidebar=categoriesSidebar)>
<!--- Include parent layout at `views/layout.cfm` --->
<cfoutput>
##includeLayout("/layout.cfm")##
</cfoutput>