Not a coldfusion specific question so answer however you can.
I've inherited a ColdFusion project where at the top of every page various page-setting specific variables are set, such as:
<cfset request.page.title = "Example Page">
<cfset request.page.machineTitle = "example_page">
<cfset request.page.isJQueryEnabled = 1>
<cfset request.page.showNavigation = 1>
<cfset request.page.SWFObjectVersion = 2.2>
I'm thinking about creating a database table with just
integer page_id
varchar key
varchar value
I'd reduce the variables at the top of every page to just the page id, and then call the DB for the correct settings.
Is this a good idea? I hate reinventing the wheel, but this is a really big project that would require many months for a full content migration to a CMS.
What are the current practices for storing page settings? (e.g., what does WordPress do? Drupal? etc.)
---- Edit ----
Adding new features/page specific scripts becomes a nightmare since I have to open every file and add/edit/remove a variable. There's no way to tell which pages are using what variables without opening them or using commandline (which I'm sure would inconvenience the other developers).
Also, what happens when I get a bunch of obsolete variables? E.g., eventually the "usePrototype" variable will be phased out and the entire site will be using jQuery.
Another method was to create and include a file with a giant switch block that sets these variables. This is done for some things already (e.g. meta tags-- switch on request.page.machine title, case xxx <meta tag whatever>
). It's a mess.