If Select attribute, then do this.

Permalink
Hey all,

My php is awful, so I'm hoping to finda little help here. This is for a custom page list.

I have a custom select attribute (drop down) that has 2 options. I'd like the user to be able to pick an option, then have that option display something.

I load up
<?php foreach ($pages as $page):
$recycle = $page->getAttribute('recycle');


I'm a little lost on the output though - I know that a checkbox value works like this:
<?php
    if (!empty($recycle)):  ?>
    <div>Yes</div>
<?php endif; ?>


I was hoping to adapt this idea to display the other value if chosen - In this instance 'No'. Anyone have any guidance here?

juddc
 

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.