Home > How-To > Formatting > Using Master.cfm for site-wide formatting

Using Master.cfm for site-wide formatting

Advanced technique makes broad changes simple

A uniform look can be maintained across all templates by also using the Master template for the “body” tag and any other elements – such as header, footer and navigation – that need to be consistent throughout the entire site.

The cleanest way to implement this is to create a table in the Master template with the modules that are consistent across the site. Use the cf_OnTheFly tag in the Master template to include these modules just as you do in your custom templates, using the “static” module to include your header and footer. Then, position the <cfinclude template=”#template#.cfm”> tag inside one of the table’s cells. If your custom template uses a table for its layout, the resulting page will appear to use nested tables, with your custom template’s table nested within the larger table in Master.cfm.

Important note: Be sure your opening and closing <body> tags appear in either the Master.cfm template only, or in all of your custom templates.