I'm using LISE for creating a testiominal module, where I need a short summary first (name, description, country-flag and avatar) and in the detail-window I also want to show some pictures (max of 4), a longer text part and a youtube video.
I've created a new instance and added some field definitions (images as 'file upload'-type) .. so far so good;
But I can't call the URL of the image, only the filename itself.
Code: Select all
<div class="row">
{if $items|@count > 0}
{foreach from=$items item=item}
<div class="col-md-4 col-sm-6">
<div class="block-text">
<a href="{$item->url}">{$item->title}</a>
<p>{$item->oneliner}</p>
</div>
<div class="person-text rel">
<img src="{$item->fielddef->avatar}" alt="Avatar">
<a title="" href="#">{$item->naam}</a>
<i><img src="https://www.domain.nl/uploads/images/flags/{$item->flag}.jpg" width="20px"/></i>
</div>
</div>
{/foreach}
{/if}
</div>Code: Select all
{$item->avatar}
{$item->fielddefs.avatar.value}
What is the right way to call images one by one? I managed to get it to work with this snippet;
Code: Select all
{foreach from=$item->fielddefs item=fielddef}
{if $fielddef.value}
{if $fielddef.type == 'SelectFile' || $fielddef.type == 'FileUpload'}
{$fielddef.name}: <a href="{$fielddef->GetImagePath(true)}/{$fielddef.value}">{$fielddef.value}</a><br />
{/if}
{/if}
{/foreach}

