Page 1 of 1

[solved] different background colour per page

Posted: Sat Nov 03, 2012 6:40 pm
by stevegos
Hi

I hope this is the right area to post this to!

I wish to have a different background colour on a div on each page. Within each page I have added a css colour reference to the Extra Page Attribute 1 and then called it in my template as {$node->extra1}

But the colour being displayed is stuck on the first page (colour) displayed and never changes when selecting other pages (or it may be co-incidence its the first colour?)

I'm using the same colour referenced under the Extra Page Attribute to also set a different background colour on each menu item and that is working fine, but I just can't get it to work in the template.

Am I missing something?

All help greatly appreciated.

Steven

Re: different background colour per page

Posted: Sat Nov 03, 2012 6:45 pm
by calguy1000
See the {page_attr} plugin. {$node} is the variable typically used in a Menumanager template.

Code: Select all

</__body style="background-color: {page_attr key='extra1'};">...<__body>
would prolly be close.

Re: different background colour per page

Posted: Sat Nov 03, 2012 6:49 pm
by stevegos
Perfect. Works great.

Thanks very much.