Thanks Josh and Laurence for your suggestions.

I went with Laurence's suggestion (sort of) and added a viewlet for the CSS. I
wrote about this on
http://keeshink.blogspot.com/2010/07/how-to-add-css-which-uses-settings-from.html,
for my own documentation as well as for the sake of discussion.

Kees

On 07/06/2010 06:26 PM, Laurence Rowe wrote:
> 
> 
> Kees Hink wrote:
>>
>> 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.
>>
> 
> I would use inline css to do this. I think the easiest way to get that to
> apply to everything is to create a plone.htmlhead.links viewlet which
> renders an inline style tag. You should be able to acquire the image name
> from your section type so it works everywhere.
> 
> (If you only want it to show on a single template just fill the style_slot)
> 
> Laurence
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to