Thanks for the pointers.
Ok, here’s how I have implemented this… views most appreciated. (btw: I am using the Structure add-on)
{!-- embeds body tag and passes structures' root node page name --}
{embed="embeds/.body_tag_open" bpb_root_page_title="{structure:top:title}"}
Then in my include I have used php (which I may hook-up to a mysql db) to retrieve the colour value of the page.
<?php
// pull from db?
$colour_array[ 'home' ] = "yellow";
$colour_array[ 'about' ] = "green";
// get lowercase page structure root node name
$page_title = strtolower( "{embed:bpb_root_page_title}" );
// get colour value from array @todo check for null…
$bpb_colour_theme = $colour_array[$page_title];
?>
<body id="theme_<?php echo $bpb_colour_theme; ?>">
<div id="wrapper">
So basically this allows me to dynamically set the template colour from any page and subpage using just one template.
This works, but is not totally ideal as I would have liked it to be controlled from within EE itself, with a drop-down menu for example. I did look into categories and relationships a little, but failed to see how this could achieve what I was after, but works for now though.
Please let us know if there is a better way to do this.
Ta! B
ps: the css styles “yellow”, “green” go based off of a colour so that in the future if (when) section names change they still make sense!