I have a grid field set up for social links. The first column selects the network, the second field a link. I'd like to have a conditional working so it tests against the content and adds corresponding classes:
{exp:channel:entries channel="social" disable="category_fields|member_data|pagination" limit="1"}{social_links}
<li class="{if {social_links:network}=="Google"}google{/if}">Our <a href="{social_links:network_url}">{social_links:network}</a></li>
<li class="{if {social_links:network}=="Twitter"}google{/if}">Follow us on <a href="{social_links:network_url}">{social_links:network}</a></li>
<li class="{if {social_links:network}=="Facebook"}google{/if}">Join us on <a href="{social_links:network_url}">{social_links:network}</a></li>
{/social_links}{/exp:channel:entries}
I'd also like to be able to test if a grid field is empty like:
{if social_links!=""}Do something {if:else} or do this{/if}
Any ideas?