RE: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict
I do exactly the same thing, except that I do it directly in the ZPT : span tal:omit-tag= tal:define=setcontentype python:here.REQUEST.RESPONSE.setHeader('content-type', 'text/css')/ Pascal AH, an elegant solution! Thanks!! -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de Andy Yates Envoyé : jeudi 31 mars 2005 21:53 À : zope@zope.org Objet : RE: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict Thanks! I've never used dtml for style sheets. I've always used page templates and never had a problem 'til now. Also, I don't see a way to set the content type on a dtml doc or method. I assume it would be text/html and then I back in the same boat. To restate my problem, FireFox in HTML 4.01 Strict mode does not seem to accept a style sheet if the content type is text/html. It needs to see text/css. (Of course IE is fat dumb and happy) Everything worked fine until I added this doc string to my page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; Unless somebody has some better magic this seems work. context.REQUEST.RESPONSE.setHeader('content-type', 'text/css') return context.stylesheet() This way I can leave the content type on the page template text/html so Zope is happy and make FireFox happy by overriding the content type to text/css. Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Winkler Sent: Thursday, March 31, 2005 12:00 PM To: zope@zope.org Subject: Re: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict 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 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict
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 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict
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 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict
I do exactly the same thing, except that I do it directly in the ZPT : span tal:omit-tag= tal:define=setcontentype python:here.REQUEST.RESPONSE.setHeader('content-type', 'text/css')/ Pascal -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de Andy Yates Envoyé : jeudi 31 mars 2005 21:53 À : zope@zope.org Objet : RE: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict Thanks! I've never used dtml for style sheets. I've always used page templates and never had a problem 'til now. Also, I don't see a way to set the content type on a dtml doc or method. I assume it would be text/html and then I back in the same boat. To restate my problem, FireFox in HTML 4.01 Strict mode does not seem to accept a style sheet if the content type is text/html. It needs to see text/css. (Of course IE is fat dumb and happy) Everything worked fine until I added this doc string to my page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; Unless somebody has some better magic this seems work. context.REQUEST.RESPONSE.setHeader('content-type', 'text/css') return context.stylesheet() This way I can leave the content type on the page template text/html so Zope is happy and make FireFox happy by overriding the content type to text/css. Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Winkler Sent: Thursday, March 31, 2005 12:00 PM To: zope@zope.org Subject: Re: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict 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 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] 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 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict
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 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict
Thanks! I've never used dtml for style sheets. I've always used page templates and never had a problem 'til now. Also, I don't see a way to set the content type on a dtml doc or method. I assume it would be text/html and then I back in the same boat. To restate my problem, FireFox in HTML 4.01 Strict mode does not seem to accept a style sheet if the content type is text/html. It needs to see text/css. (Of course IE is fat dumb and happy) Everything worked fine until I added this doc string to my page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; Unless somebody has some better magic this seems work. context.REQUEST.RESPONSE.setHeader('content-type', 'text/css') return context.stylesheet() This way I can leave the content type on the page template text/html so Zope is happy and make FireFox happy by overriding the content type to text/css. Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Winkler Sent: Thursday, March 31, 2005 12:00 PM To: zope@zope.org Subject: Re: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict 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 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )