BoldMinded acquires Ansel, support ending for all add-ons. BoldMinded acquires Ansel, support ending for all add-ons. Read More →
Support has been discontinued. Issues remain available as an archive. Support has been discontinued. Issues remain available as an archive.
Ansel in Bloq failing conditional
#46 opened by obfuscode
Description
It looks like Ansel is ignoring the conditional check when it's inside a Bloqs field.
{four_column_images} <!-- Bloqs Field -->
{if column_1_image}<img src="{column_1_image}{img:url}{/column_1_image}" />{/if}
{if column_2_image}<img src="{column_2_image}{img:url}{/column_2_image}" />{/if}
{if column_3_image}<img src="{column_3_image}{img:url}{/column_3_image}" />{/if}
{/four_column_images}
Results in:
<img src="http://domain.com/saved/myimage-20-1504636757.png" />
<img src="" alt="" />
<img src="http://domain.com/saved/myimage-22-1504636757.png" />
<img src="http://domain.com/saved/myimage-23-1504636757.png" />
Replies
- obfuscode
Replied 9/6/2017 8:05 AM, Edited 9/8/2017 10:17 AM
Changed my conditionals to this for now and it works so no urgency on this request:
- TJ Draper
Replied 9/6/2017 12:47 PM, Edited 9/8/2017 10:17 AM
Because of various and sundry programming reasons, you can't check an Ansel field directly in a conditional. You would need to do something like
{if "{column_1_image count='true'}" > 0}
- obfuscode
Replied 9/6/2017 12:49 PM, Edited 9/8/2017 10:17 AM
Just in a Bloq? Your documentation has it listed in the tags for general Ansel fields.
{!-- Check if field has images --} {if my_ansel_field} // Do stuff if field has images {/if}
- TJ Draper
Replied 9/6/2017 12:52 PM, Edited 9/8/2017 10:17 AM
Yikes. I’m not sure why that's in my documentation to be honest. That's never been a thing because of the way the tag pair works. I definitely messed that documentation up. I’ll fix that as soon as I can.
- obfuscode
Replied 9/6/2017 12:54 PM, Edited 9/8/2017 10:17 AM
Gotcha, no problem! Thank you!