Layout Components 1.0 Documentation: Switch Layout

Layout Components Information

Download from RIA Forge

Blog Entries

Switch Layout

You may want to use a layout other than the Default layout on a page. Here are examples of using the "Home" layout (assuming there is a "Home.cfc" in your "layouts" folder).

Using cf_Template

<cf_Template use="Home" title="Page Title">

(some content here)

</cf_Template>

Using cf_layout

<cf_layout switch="Home">

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

(some content here)

<cf_layout>

Direct CFC Code

<cfset layout = layout.switchLayout("Home")>

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

(some content here)

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