[Zope] 'Netscape style.css recursion' & Zope - Gotcha

Joel Burton jburton@scw.org
Tue, 31 Jul 2001 08:56:29 -0400 (EDT)


On Tue, 31 Jul 2001, Chris Hinds wrote:

> This causes Netscape to retrieve http://127.0.0.1:8080/fu/bar/style.css which 
> of course it can't find, so it tries again, and again.... (_duh_)
> 

IE doesn't exhibit this behavior -- it doesn't find the style sheet,
of course, but it doesn't hang in recursion.

> So the moral of this story:
> - In line you style sheets?

... which makes your user download your CSS w/everypage. Very non-optimal.

> - use an absolute link to style.css not a relative one?

... which makes it difficult to use cool Zope tricks, such as having
style.css in a folder that overrides the styles for particular parts of
a site.

Of course, using just a relative link means that your users browser has to
request /site/foo/style.css, /site/bar/style.css, /site/baz/style.css (due
to inheritance), and the browser won't be able to use a cached copy much
of the time anyway, because it appears to be a different css sheet.

> - have a more independent standard_error_message page?
> - get Zope to redirect to a standard error page rather than inherit it?

Why not:

  <link rel="stylesheet" type="text/css" href="<dtml-var style.css url>">

This way, you get the benefit of inheritance (you can override style.css
in a folder), Zope always returns the same URL for the same css file,
so caching can work, and if finds the correct file when there is an
error. (http://site/no/such/dir) still shows CSS, so the Netscape
recursion problem should go away.


-- 
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington