[Zope-dev] Re: ZPT for CSS, anyone?
Chris Withers
lists at simplistix.co.uk
Thu Apr 1 16:34:37 EST 2004
Shane Hathaway wrote:
> BTW instead of TAL, it should be called SAL, Style Attribute Language.
> TAL needs a sister. :-)
Arg! No more languages! :'(
Still, maybe a TALES-in-plain-text thing has some merits, but then you want
defines, a repeats, and you end up with TAL.
*grunt*
still, I suppose:
template="""
p {
color: %(color)s;
background-color: %(bgcolor)s;
}
"""
preferences = context.getProperty('preferences',{})
dict = {
'color':preferences.get('color','gray'),
'bgcolor':preferences.get('bgcolor'white'),
}
return template % dict
...does the job in the correct fashion...
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope-Dev
mailing list