[Solved]Products module detail template {if}{/if} question
Posted: Tue Aug 20, 2013 3:17 am
Using 1.11.7 and up to date modules
In detail template:
If a product has only 8 images, how do I make sure only 8 are shown and not the 2 empty boxes as well? I used {if}{/if} on another site to show only available contentblocks but not sure how to implement that here.
Would appreciate some advice.
Thanks
I've experimented with :
and this seems to work. Is it correct syntax?
Thanks
In detail template:
Code: Select all
<div id="imagebox">
<ul class="img">
<li><div>
<a href="{$entry->file_location}/{$entry->fields.photo1->value}" ><img src="{$entry->file_location}/{$entry->fields.photo1->thumbnail}"></a></div></li>
... through to
<li><div>
<a href="{$entry->file_location}/{$entry->fields.photo10->value}"><img src="{$entry->file_location}/{$entry->fields.photo10->thumbnail}"></a></div></li>
</ul>
</div>Would appreciate some advice.
Thanks
I've experimented with :
Code: Select all
{if $entry->fields.photo10->value}<li><div>
<a href="{$entry->file_location}/{$entry->fields.photo10->value}"><img src="{$entry->file_location}/{$entry->fields.photo10->thumbnail}"></a></div></li>{/if}Thanks