Setting an a Select attribute to display a relevant image.

Permalink
Hi all,

Can someone point me in the right direction. I'm creating a custom attribute which is a Select list of say 5 options. When this will be displayed via a page list block I would like to replace each option with a relevant image.

Whats the best way to achieve this in a custom page list template?

Many thanks

Stu

 
hutman replied on at Permalink Best Answer Reply
hutman
This should be pretty straightforward

$value = $page->getAttribute('attribute_handle');
switch($value){
    case 'option1':
        //output image for option 1
        break;
    case 'option2':
        //output image for option 2
        break;
}
srsdesign replied on at Permalink Reply
Perfect....many thanks