events/Resources/Private/Templates/Event/Search.html
Daniel Siepmann 8201782b6f Properly check for images
Do not check for models, but actual file.
They might be missing, e.g. cause not downloaded from production into
dev environment.

The new checks ensure the page will not break with an exception, but
show default images.
2021-09-07 07:54:42 +02:00

29 lines
1.3 KiB
HTML

<f:render partial="Event/SearchForm" arguments="{search: search}"/>
<div class="row">
<f:for each="{events}" as="event">
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
<div class="menu-tile">
<f:if condition="{event.images.0}">
<f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}">
<f:image image="{event.images.0}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action>
</f:then>
<f:else>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}">
<img src="{settings.defaultImagePath}" alt="Dummy" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action>
</f:else>
</f:if>
</div>
<div class="caption">
<div class="caption-text mt-3">
{event.region.title}
<h4>{event.title}</h4>
<p>{event.teaser}</p>
</div>
</div>
</div>
</f:for>
</div>