Shannon Rhodes wrote: > > I think I need a balance between letting CF templates "do it all" for me, > and the tedious work of writing in each page information that is probably > the same 80% of the time in a given section. > > Can anyone suggest a "best practices" approach to using cfinclude for design > elements? Should I hard code in most of the head area of documents, so I > can put in page-level titles, meta tags, and page-specific styles & > JavaScript, followed by a cfinclude containing the remainder of the head > with links to the master style sheet, and any design code that will not > change, followed by another include for section-specific design images? Any > suggestions are appreciated! > >
Shannon, Assuming that my previous email got bounced by the CF-talk bot for not recognizing my munged email address, I'm trying this one again. If not I apologise for the duplicate posting. First of all I'd avoid putting the header and footers in you application.cfm and onrequestend.cfm pages. Those should be used for code specifics. Here's what I do, create a template in Dreamweaver and where the content is to go, have a cfoutput, something like this: <cfoutput>#variables.ResultsOutput#</cfoutput> Then on the pages with the processing and other cfcode, surround that code with a cfsavecontent. Then you use an cfinclude to get the template as in <cfsavecontent variable = "variables.ResultsOutput"> <!--- whatever cf code goes in there ---> </cfsavecontent> <cfinclude template="Display_template.cfm> Alternatively you could set which particular template to use based on the processing results. This approach allows you to be very flexible in your template handling. Another advantage is that if you use Dreamweaver to design your templates, you can update or change the display template without having to worry about messing up your CF code. Assuming that the power has been restored at my former employer, you can see an example of this at http://www.totalsports.us. hth, larry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137751 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com