Robert, The array of page information is a good idea, if your site isn't massive. I draw those details into the variables scope for two reasons: 1) It helps me keep track of all of the variables I'm using within a template 2) It's something I've seen others do who are far smarter than I am
I don't think, to the app, it matters which way you reference them. It does make sense for variables that may be used in multiple locations within your template, so that you call the getValue() method for that variable only once. Steve "Cutter" Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _____________________________ http://blog.cutterscrossing.com Robert Rawlins - Think Blue wrote: > Nice work Cutter, > > That was a short and sweet tutorial and gives me a good kick in the right > direction, I wasn't aware that I could set values in the XML manually like > that. There are a couple of ideas or questions I'd like to run past you > though. > > Firstly is regarding the database driven titles, this seems like a fair > enough concept to me, but I'm a little worried about making database calls > on every page just to collect titles and keywords etc, so what I'm thinking > is building a bean on application start which contains an array with all the > database information in, this way when each page loads it'll only need a > quick reference to the bean in memory, rather than pulling from SQL, does > that sound like a reasonable idea? > > Also, I notice in your tutorial that at the top of your template view you > set all the drawn details from the framework into the variables scope like > so. > > <cfset variables.pageTitle = "My Site: " /> > <cfset variables.pageTitle = variables.pageTitle & > viewState.getValue("pageTitle","Home") /> > <cfset variables.pageKeywords = viewState.getValue("pageKeywords","") /> > <cfset variables.pageDescription = viewState.getValue("pageDescription","") > /> > <cfset variables.additionalStyleSheets = > viewState.getValue("additionalStyleSheets","") /> > <cfset variables.additionalScripts = > viewState.getValue("additionalScripts","") /> > <cfset variables.siteSection = viewState.getValue("siteSection","") /> > > Is there any reason behind doing this? Or would the app be just as happy for > me to reference it as > <cfoutput>#viewState.getValue("pageKeywords","")#</cfoutput>? > > Thanks again for the advice, > > Rob > > -----Original Message----- > From: Cutter (CFRelated) [mailto:[EMAIL PROTECTED] > Sent: 15 March 2007 13:24 > To: CF-Talk > Subject: Re: Dynamic <title> In Model-Glue > > Robert, > > See the tutorial on my blog, "Making The View". My last installment > covered MG:U, and includes a basic example (though probably better to db > the info and pull it in per page view). It should at least get you started. > > Steve "Cutter" Blades > Adobe Certified Professional > Advanced Macromedia ColdFusion MX 7 Developer > _____________________________ > http://blog.cutterscrossing.com > > Robert Rawlins - Think Blue wrote: > >>Hello Guys, >> >> >> >>Has anyone done any work with dynamic titles and meta tags using MG? I'm a >>little lost on how best to achieve it, the idea is the content for the > > tags > >>will change for every page to make them more relevant to the exact > > content. > >> >> >>I've using the standard dspTemplate.cfm method at the moment to wrap my >>contact in a universal template. I'd love to hear what you guys are doing > > to > >>achieve a little more flexibility in this template. >> >> >> >>Rob >> >> >> >> > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272724 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

