I would like to store style sheet information in a database but need to be able to change some of the parameters on the fly.  If a straight file doing the variable substitutions is no big deal.

<cfquery name="specs" datasource="#dsn#">
   SELECT
      color
   FROM
      spec_table
   WHERE
      customer = 42
</cfquery>

<cfset variables.bgcolor = spec.color>

<cfoutput>
   <style type="text/css">
      div.template1{
       width: 300;
       height: 250;
       border: 1px solid black;
       background-color : #variables.bgcolor#;
      }
   </style>
</cfoutput>

Yes I know I don't need to use the extra step in this case but if it is stored in a DB I need constant names in string.

So is it possible to store the style block in  a DB and then do the variable replacement?

Shawn McKee
Mgr., Web Development
http://www.newsstand.com
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to