Forum OpenACS Q&A: Re: Arbitrary Template File Extensions

Collapse
Posted by Mat Kovach on
Of course, you could put something in the master templated that picks the css files based on site_id, or package_id, etc.

Add something like:

in the master .tcl

set package_id [ad_conn package_id]

if { css file doe snot exists for package_id }
  set css_file "default.css"
else
  set css_file "package_id.css"

then in master.adp

<link href="/templates/@css_file@" rel="sytlesheet" type="text/css">

You would just have to logic for the decieding on which css file to use.

Collapse
Posted by Ralph Hempel on
Yep, that will work just fine. And I could even generate the css file dynamically and make sure it's in the file system before the current page is returned.

That way the browser can fetch it (as needed) and the css file will have automatically generated values.

I could also just leave the CSS file as a static file....

Collapse
Posted by Jarkko Laine on
Maybe you can even make a vuh file that is being called in Mat's solution instead of static css files (in case you really want to create the css just-in-time).

It could then do whatever smart logic you want it to do.