Hello,
I have this code in a content template :
<div class="eltdf-social-share-holder eltdf-list">
<ul>
<li>{!{types field='instagram' title='Instagram'}!}{!{/types}!}</li>
<li>{!{types field='facebook' title='Facebook'}!}{!{/types}!}</li>
<li>{!{types field='youtube' title='Youtube'}!}{!{/types}!}</li>
<li>{!{types field='trip-advisor' title='Trip Advisor'}!}{!{/types}!}</li>
</ul>
</div>
Wich work well, but if a field isempty, there is an extra space
Adding conditonal outpout broke my code :
<div class="eltdf-social-share-holder eltdf-list">
<ul>
{!{wpv-conditional if="( $(wpcf-instagram) eq '' )"}!}<li>{!{types field='instagram' title='Instagram'}!}{!{/types}!}</li>{!{/wpv-conditional}!}
{!{wpv-conditional if="( $(wpcf-facebook) eq '' )"}!}<li>{!{types field='facebook' title='Facebook'}!}{!{/types}!}</li>{!{/wpv-conditional}!}
{!{wpv-conditional if="( $(wpcf-youtube) eq '' )"}!}<li>{!{types field='youtube' title='Youtube'}!}{!{/types}!}</li>{!{/wpv-conditional}!}
{!{wpv-conditional if="( $(wpcf-trip-advisor) eq '' )"}!}<li>{!{types field='trip-advisor' title='Trip Advisor'}!}{!{/types}!}</li>{!{/wpv-conditional}!}
</ul>
</div>
After saving the code become :
<div class="eltdf-social-share-holder eltdf-list">
<ul>
<li style="list-style-type: none">
<ul>{!{wpv-conditional if="( $(wpcf-instagram) eq '' )"}!}
<li>{!{types field='instagram' title='Instagram'}!}{!{/types}!}</li>
</ul>
</li>
</ul>
{!{/wpv-conditional}!}
{!{wpv-conditional if="( $(wpcf-facebook) eq '' )"}!}
<ul>
<li style="list-style-type: none">
<ul>
<li>{!{types field='facebook' title='Facebook'}!}{!{/types}!}</li>
</ul>
</li>
</ul>
{!{/wpv-conditional}!}
{!{wpv-conditional if="( $(wpcf-youtube) eq '' )"}!}
<ul>
<li style="list-style-type: none">
<ul>
<li>{!{types field='youtube' title='Youtube'}!}{!{/types}!}</li>
</ul>
</li>
</ul>
{!{/wpv-conditional}!}
{!{wpv-conditional if="( $(wpcf-trip-advisor) eq '' )"}!}
<ul>
<li style="list-style-type: none">
<ul>
<li>{!{types field='trip-advisor' title='Trip Advisor'}!}{!{/types}!}</li>
</ul>
</li>
</ul>
{!{/wpv-conditional}!}
</div>
Thank you for your help
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hello,
Thank you for contacting our support forum.
Could you try adding the
tags on the outside of the conditionals instead of having the conditionals wrapping them.
This should resolve the issue.
Thanks,
Shane