I’m trying to get control the display of images on a page using a conditional based on the value of an FF Radio Group custom field. The two options for that field are Vertical and Horizontal.
If I use an FF Checkbox Group custom field – which isn’t ideal since this is an either/or situation – the code below works perfectly but if I use an FF Radio Group custom field, nothing displays.
Here’s my code…
{exp:weblog:entries weblog="members_photos"}
{if {members_photo_size:selected option="Vertical"}}
{!-- Display image using IMG_SIZER with height value set --}
{/if}
{if {members_photo_size:selected option="Horizontal"}}
{!-- Display image using IMG_SIZER with width value set --}
{/if}
{/exp:weblog:entries}It seems to be that since a radio button and a checkbox are so closely related – the only difference being that with a radio button group only one choice can be selected – that surely the code for displaying content based on the field setting should be the same?
UPDATE Seems to is doable by using
{exp:weblog:entries weblog="members_photos"}
{if members_photo_size=="Vertical"}
{!-- Display image using IMG_SIZER with height value set --}
{/if}
{if members_photo_size=="Horizontal"}
{!-- Display image using IMG_SIZER with width value set --}
{/if}
{/exp:weblog:entries}Must not have had enough caffine in me. Feel free to close this thread.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.