Dynamic Zope Style Sheets with HTML 4.01 Strict
Good day everyone! I added a doc type string to one of my Zope pages because it needed to pass an HTML 4.01 Strict validator. When I did this FireFox seems to ignore the style sheet. My style sheet is dynamic so I used a page template and tal. If the Content Type on the style sheet is set to text/html FireFox will not load the style sheet. If I set the Content Type to text/css I get an error when I save the page. Compilation failed xml.parsers.expat.ExpatError: syntax error: line 3, column 0 If I make my style sheet with a file and content type of text/cc instead of a page template FireFox loads the style sheet but the tal statements do not get rendered. So, how do I make a dynamic style sheet that has the correct (text/css) content type? Am I going to have to write a python script to call the style sheet page template and change the content type or is there a better way to handle this? Thanks! Andy
On Thu, Mar 31, 2005 at 11:38:59AM -0600, Andy Yates wrote:
Am I going to have to write a python script to call the style sheet page template and change the content type or is there a better way to handle this?
Page Templates are awkward to use for non-XML output. I never tried to use them for stylesheets. fwiw, I have good results using DTML Methods for my dynamic stylesheets. It's about the only thing I use DTML for anymore. Mine look roughly like this: <dtml-with SomethingThatGivesMeABunchOfProperties> body { background-color: &dtml-mainBackgroundColor;; color: &dtml-mainTextColor;; } /* more style rules follow */ ... </dtml-with> -- Paul Winkler http://www.slinkp.com
Andy Yates wrote:
Compilation failed xml.parsers.expat.ExpatError: syntax error: line 3, column 0
This just means you had an XML error in your css ZPT. Usually a missing close tag or / in a <something /> will do it. Don't use DTML, it's evil, you're doing the right thing already ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
http://simplates.zetaweb.com/ On 31. Mär 2005, at 19:38, Andy Yates wrote:
So, how do I make a dynamic style sheet that has the correct (text/css) content type?
-- Software Engineering is Programming when you can't. --E. W. Dykstra
participants (4)
-
Andy Yates -
Chris Withers -
Paul Winkler -
Stefan H. Holek