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

Collapse
Posted by Ralph Hempel on
Vinod,

I guess in general, what I want to have is a way of telling OpenACS to use extension "xyz" in exactly the same way as if it was an "adp" file.

The browser asks for "screen.css" and my (ideal) OpenACS server says, hmmm, I'd better run this through the template system and return screen.css with all of the variables set to the new values.

This part of your description is almost right...

You have <p class="foo"> in your index.adp file. You want the "foo" class to be blue in some circumstances and orange in other circumstances. So when index.adp links out to screen.css, you want screen.css to be built dynamically with the "foo" class set to the proper color.

In fact, I'll have one set of pages on my website where foo is blue, and another set of pages where foo is orange. They don;t change on a single page. Depending on where in the tree the index.adp file is, it will link in a different screen.css file with the colour attribute set appropriately.

Being a lazy programmer, and realizing that my css files are almost identical, and not wanting to synchronize them, I through that passing them through the template system might do what I want.

I _could_ just write up a tcl script that uses a master screen.css file and writes out the site dependent screen.css files as needed....