Have you looked at some of the sub-site products (like collective.lineage)?
If they don't do what you  want, they may give you some insight. 

You could override main_template, and change it so that your
context-sensitive CSS is rendered based on the context. You could also do it
in a browser vivew or page template (there's a metal slot where you can
inject link tags). 

Are you using DTML in your style sheet to do the dynamic stuff? you could
consider setting up a page template (or a browser view) and using that as
CSS. As long as you link it to the context (again, probably easiest to do
from main_template...add a link tag to something like
view/context/@@mydynamic.css). You may have to fiddle with the request
object to get it to pass the right Content-Type header.

That's just off the top of my head, I'm sure other people have dealt with
this sort of thing before.

HTH,
JJ

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Kees Hink
Sent: Tuesday, July 06, 2010 10:50 AM
To: [email protected]
Subject: [Product-Developers] how to create CSS from content

I would like to allow non-technical users to set a background image for a
section of the site. As a first step to achieve this, I've added an image
field
to the content type which constitutes such a section, but how can i get it
into
CSS?

I've tried registering a new CSS resource in portal_css. The problem with
this
is that the context of portal_css is always the Plone Site, so the page
template or view class the generates the resource has this as its context.

Kees
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to