SV: [ZPT] playing with stylesheets in ZPT?
Geir Bækholt
geirh@funcom.com
Mon, 9 Apr 2001 11:23:37 +0200
couldn't you just make a <style tal:replace="structure
here/dtml_method_that_returns_a_style_tag_with_proper_linking></styl
e>
and then a second <style></style> - set for your designers to fiddle
with...??
perhaps i misunderstood your problem, but i am currently of the
opinion that dynamicism inside style or script elements would be
simpler in dtml/python , and just fetching the entire block into
your template with tal:replace or tal:content...
Geir Bækholt
geirh@funcom.com
>Let's say that we have an object tree where every page in the tree
has the
>following in it:
>
><style type="text/css">
>body {
> background-repeat: no-repeat; background-image:
url(images/main_back.gif)
>}
></style>
>
>The images dictionary is an acquired attribute. If we're to avoid
reloading
>the background image for every page down the acuisition tree, then
we need
>to modify that 'images/main_back.gif' url so it is the same on each
page.
>We can do it for <img> tags by preprocessing the page and inserting
>tal:attributes attributes to do the job. Not so for the contents of
the
>style tag.
>
>In the Bad Ol Days of DTML, I just had a dtml statement in there,
like
> url(<dtml-var "path_to_images(REQUEST)">/main_back.gif)
>which worked just fine and dandy... ;)
>
>Now, remembering that this CSS may be entered by any random Web
Designer
>and that it may contain any number of other statements, possibly
with a
>bunch of other url(images/blah.gif) in them...
>
>It's currently impossible as far as I can tell, to have ZPT do what
I used
>to do in DTML.
>
>What _would_ make it possible, would be to be able to, say,
>
><style type="text/css" tal:process="here/image_path_fix>
>body {
> background-repeat: no-repeat; background-image:
url(images/main_back.gif)
>}
></style>
>
>Where image_path_fix is a method that accepts the content of the
<style>
>... </style> tag, and spits out some possibly modified content...
>
>Thoughts?
>
>
> Richard
>
>ps. of course, if someone else has another solution to the "moving
images
>directory" problem, I'd _love_ to hear it :)
>
>--
>Richard Jones
>richard@bizarsoftware.com.au
>Senior Software Developer, Bizar Software
(www.bizarsoftware.com.au)
>
>_______________________________________________
>ZPT mailing list
>ZPT@zope.org
>http://lists.zope.org/mailman/listinfo/zpt
>