Dynamic area in a CSS design file to switch bg image - possible?

Hi everyone,

 

I've just started implementing a new design into Matrix, which has a bg image on the body tag. But that image will change for each of the 5 sections of the site.

 

So, other than creating 5 different css files and linking them to different customisations, is there a neater way to dynamically put the bg image name into the CSS design file?

 

I've tried to output a design variable from the design parse file, and I've tried a global keyword to output some metadata of the page, but either its not possible or I've got the syntax wrong.

 

What I'd like is something simple like:

 

body{

background-image: url( [use variable set in design customisation, or some metadata here].jpg) fixed no-repeat;

}

 

 

All help and ideas very welcome, thanks! Charlie.

 

I've figured it out! (that happens quite a lot just after I post up for help on here!).

 

I didn't realise that you can put the same <Mysource_Area> tags into a design css file, just like an html design file. So I've put in a declared_vars area, created some customisations and put the path of the images that I want into those customisations, and presto - it works!

 

Brilliant ;o)

Bit dirty but inline CSS for these 5 sections would have been a lot easier option?

Hi Tbaatar,

 

Inline... could have done. But i'd still have had to make the inline style a nested content area and then customised it for each section with a hard-coded src for the image. So doing that vs doing the customisations of the css probably works out the same. And I'm never a fan of inline css - seems ok as a quick fix but then you want to control things in print stylesheets and accessibilty switcher stylesheets and it can cause you a problem!

 

C.