We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

FF Radio Group Values and Conditional?

Development and Programming

Brooks Seymore's avatar
Brooks Seymore
106 posts
16 years ago
Brooks Seymore's avatar Brooks Seymore

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.