Layout Components 1.0 Documentation: Include a File

Layout Components Information

Download from RIA Forge

Blog Entries

Include a File

You can include a file using a layout from another using a layout without having the layout appear twice on the page. To do so, you must use the "include" functionality of Layout Components, which does have some restrictions.

Other than those restrictions, however, everything should work as you would expect.

Using cf_Template

<cf_Template title="Page Title">

<cf_layout include="/mypage.cfm">

</cf_Template>

Using cf_layout

<cf_layout title="Page Title">
<cf_layout>

<cf_layout include="/mypage.cfm">

<cf_layout>

Direct CFC Code

<cfoutput>#layout.head("Page Title")#</cfoutput>
<cfoutput>#layout.body()#</cfoutput>

<cfset layout.include("/mypage.cfm",variables)>

<cfoutput>#layout.end()#</cfoutput>