Structuring a master page I have a small Coldfusion section of our site that all uses similar JavaScript and CSS files and page design. The code is currently repeated for each file, and I'd like to factor it out and set something up using a master page and templates.

Master.cfm page:

&lt;!--- Master template, includes all necessary js and css files. 
    Expects following variables to be defined:
    - pageName - name of the file to be loaded as the body of the page 
    - title - text to be used as the title of the page and as the header text in the header bar ---&gt;
&lt;cfinclude template="_lockedPage.cfm" /&gt;

&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
        &lt;title&gt;#title#&lt;/title&gt;
        ... all script and css links here ...
        &lt;script type="text/javascript" src="js/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="js/jquery.mobile-1.3.2.js"&gt;&lt;/script&gt;
        ... etc ...
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div data-role="page"&gt;
            &lt;div class="headerDiv" data-role="header" data-theme="b" data-position="fixed"&gt;
                &lt;a id="backButton" data-role="button" data-direction="reverse" data-rel="back" data-icon="arrow-l" data-iconpos="left" data-theme="a"&gt;Back&lt;/a&gt;
                &lt;h1&gt;&lt;cfoutput&gt;#title#&lt;/cfoutput&gt;&lt;/h1&gt;
                &lt;a href="index.cfm" data-role="button" data-icon="home" data-iconpos="left" data-theme="a"&gt;Home&lt;/a&gt;
            &lt;/div&gt;
            &lt;div data-role="content" class="container"&gt;
                &lt;cfinclude template="#pageName#.cfm" /&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;


Then a page example would be something like this. CustomerSearch.cfm:

&lt;cfscript&gt;
    title = "Customer Search";
    pageName = "_customer-search";
    include "Master.cfm";
&lt;/cfscript&gt;


And then I would need a _customer-search.cfm page that would include all the body content for the page.

This means that I would need 2 files for every page that we currently have - the outer page that defines the variable and includes the master page, and the template page that has the individual page content.

Is this a good logical design? Is there anyway to improve it?
My ColdFusion is a little rusty, but why would you not have the setting of the master dependent variables and the call to the master page both contained within the same page? Other than that, sure, you're implementing this the same way everyone does unless it's specifically built into the language.