Jump to content

Placeholder for missing formValue


Koper74

Recommended Posts

Posted

Hello,

I use this syntax to set an upload-field (images only) when there is no content:

{{if $formValue }}
<img src="{$value}" class="ma_passbild">
{{else}}
<img src="https://loremipsum.info/uploads/pages_media/0_avatar.png" class="ma_passbild">
{{endif}}

 

It only works when the field is linked hardcoded via display template:

<div class="passbild">{$record->customFieldDisplayByKey('foto', 'display')|raw}</div>

 

In my listing template I've got to use it like this - unfortunately it doesn't work:

{{foreach $row->customFieldsForDisplay('listing') as $fieldId => $fieldValue}}
	{{if $fieldValue}}
		{$fieldValue|raw}
	{{endif}}
{{endforeach}}             

 

PHP is not my strength but I guess this part is the problem!?

as $fieldId => $fieldValue}}


I would be gratefull for any tips or ideas... 😉

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...