Templating JavaScript and CSS files with TAL

207 views Asked by At

Is it possible to template JavaScript or CSS files with TAL?

(or maybe there is some other templating mechanism in Zope exists)

 

e.g. templated CSS file will be something like that:

#button {
  background-color: <%= buttonColor %>;
  background-image: <%= buttonImage %>;
}
1

There are 1 answers

0
sdupton On

If you are using Zope2, use DTML. TAL/ZPT is only appropriate for HTML/XML/SGMLish markups.

If you are using browser views, you can also choose to use any Python-based template system, should you be willing to take care of rendering the template in your view's index() (or __call__()) method.