Some help needed with LISE

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
brentnl
Power Poster
Power Poster
Posts: 493
Joined: Mon May 11, 2009 4:35 pm

Some help needed with LISE

Post by brentnl »

Hi,

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}
Both strings give the same output, but {$item->fielddefs.avatar.path} (or 'url' or 'GetImagePath') doesn't work as expected.

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}
But that outputs every single 'fileupload' field..
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: Some help needed with LISE

Post by paulbaker »

For me, this works:

Code: Select all

<img src='/uploads/images/people/{$item->photo}'>
So you should just change photo to avatar. The folder is specified when you create or edit the field definition for your file upload fields. The {$item->photo} just outputs the filename only.
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
Locked

Return to “Modules/Add-Ons”