I just need to check if one field artist_gallery:image in a grid field is set, if not the markup should not be rendered. This syntax {if "{artist_gallery:total_rows}” > 0} or {if artist_gallery:total_rows > 0} is not working … if there is no image, the markup is rendered.
Any ideas? Thank you!
{if "{artist_gallery:total_rows}" > 0}
<div id="artistgallery">
<div class="cycle-slideshow">
{artist_gallery}
{artist_gallery:image}
{/artist_gallery}
</div>
<div id="adv-custom-pager" ></div>
<div class="clb"></div>
</div>
{/if}
I have no idea whats the deal with total codes in your template and how you have built it, but have you tried this:
{artist_gallery}
<div id="artistgallery">
<div class="cycle-slideshow">
{artist_gallery:image}
</div>
<div id="adv-custom-pager" ></div>
<div class="clb"></div>
</div>
{/artist_gallery}
Havent tried but it should not show anything if there is no image available?
So you want to pull out less markup, and the conditional is working when there is images right?
What about this then, (if your code is working when images available):
{if "{artist_gallery:total_rows}" > 0}
<div id="artistgallery">
<div class="cycle-slideshow">
{artist_gallery}
{artist_gallery:image}
{/artist_gallery}
</div>
<div id="adv-custom-pager" ></div>
<div class="clb"></div>
</div>
{if:else}
FOO and a BAR :blush:
{/if}
I have no idea again, does that produce some sort of conflict…
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.