LocalFS problems with @import-ing stylesheets
Hi We've just upgraded to using LocalFS (LocalFS-1-3-andreas for the large file support) with Zope 2.7.2, and have been experiencing problems with accessing stylesheets via the @import command from within a LocalFS folder. eg: <style type="text/css" media="screen"> <!-- @import url(/site/style.css); --> </style> where /site is the LocalFS folder. The problem only manifests itself using Mozilla browsers (Mozilla, Firefox, etc), and when using these browsers stylesheets are successfully requested (according to the Apache access logs) but are ignored within the page. The stylesheet validates, and works as expected if moved inline within the page, or when created as a Zope File object, rather than within LocalFS. This all worked fine on the previous versions of LocalFS we were using (1.1.0) with Zope 2.6.4. Any ideas if this is a Zope or a LocalFS thing? Cheers Paul -- ---------------------------------------------------------------------- Paul.Smith@bristol.ac.uk ---------------------------------------------------------------------- Senior Technical Officer | Technical Manager Internet Development Group | RDN Virtual Training Suite http://www.ilrt.bris.ac.uk/id/ | http://www.vts.rdn.ac.uk/ ---------------------------------------------------------------------- Institute for Learning and Research Technology, University of Bristol, 8-10 Berkeley Square, Bristol BS8 1HH, UK Tel: +44 (0)117 928 7192, Fax: +44 (0)117 928 7112
Paul Smith wrote at 2004-9-6 15:55 +0100:
... <style type="text/css" media="screen"> <!-- @import url(/site/style.css); --> </style>
where /site is the LocalFS folder. The problem only manifests itself using Mozilla browsers (Mozilla, Firefox, etc), and when using these browsers stylesheets are successfully requested (according to the Apache access logs) but are ignored within the page.
Does not look like a Zope/LocalFS problem. -- Dieter
I can confirm the problem, the stylesheet is not rendered from localfs with firefox the problem is caused by an incorect http header "text/plain" instead of "text/css" I've tried to add a type_map to the LocalFS but the content-type does not change so, for me, it is clearly a LocalFS issue anyone knows how to hardcode this content-type in LocalFS.py ?
2005/10/10, Samuel Souk-aloun <samsouk@noos.fr>:
I can confirm the problem, the stylesheet is not rendered from localfs with firefox
the problem is caused by an incorect http header "text/plain" instead of "text/css" I've tried to add a type_map to the LocalFS but the content-type does not change so, for me, it is clearly a LocalFS issue
anyone knows how to hardcode this content-type in LocalFS.py ?
How about setting the content-type in the stylesheet file? That's what I always do. <dtml-call "RESPONSE.setHeader('Content-Type','text/css')"> -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
Samuel Souk-aloun wrote:
I can confirm the problem, the stylesheet is not rendered from localfs with firefox
the problem is caused by an incorect http header "text/plain" instead of "text/css" I've tried to add a type_map to the LocalFS but the content-type does not change so, for me, it is clearly a LocalFS issue
anyone knows how to hardcode this content-type in LocalFS.py ? _______________________________________________ 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 )
add this line to the typemap: .css text/css DTMLDocument It works for me I hardcoded it into LocalFS.py (the last line is the one you need to add): _types = { '.html': ('text/html', 'DTMLDocument'), '.htm': ('text/html', 'DTMLDocument'), '.css': ('text/css', 'DTMLDocument'), # ***SmileyChris *NEW*
participants (5)
-
Chris Beaven -
Dieter Maurer -
Paul Smith -
Peter Bengtsson -
Samuel Souk-aloun