Getting Page Attribute Select Value

Permalink
I have created a custom page attribute called 'background_theme'.

This will be used where users can change the properties of the page attribute to select from a drop down one of theme options.

What I am trying to do is in the header.php is look at the page's attribute and bring in an extra style sheet if it is selected.

As this attribute is a select attribute I can get object properties that include the ID, Value etc, but I cannot seem to work out how to access the value.

I am probably missing something really simple.

isitetv
 
nicolechung replied on at Permalink Reply
I had the same problem this morning.

I kind of feel like there is something not working with select / checkbox attributes, but I think it would be something like:

Loader::model('page_list');
$pl = new PageList();
$pl->filterByBackgroundTheme('theme_name');
$pages = $pl->get();
// see what the pages contain:
echo '<pre>';
var_dump($pages);

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.