Avoid empty teaser for disabled concept

This commit is contained in:
Björn Fromme
2022-06-07 12:43:24 +02:00
parent 7030beea6f
commit 2f766a3ba9
@@ -4,45 +4,47 @@
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"> xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:section name="Teaser"> <f:section name="Teaser">
<a href="{f:uri.typolink(parameter: concept.detailPage)}" title="{concept.name}" class="flex flex-col"> <f:if condition="{concept}">
<div class="relative"> <a href="{f:uri.typolink(parameter: concept.detailPage)}" title="{concept.name}" class="flex flex-col">
<f:alias map="{teaserImage: concept.teaserImage, defaultImage: concept.headerImage}"> <div class="relative">
<f:if condition="{teaserImage}"> <f:alias map="{teaserImage: concept.teaserImage, defaultImage: concept.headerImage}">
<f:then> <f:if condition="{teaserImage}">
<f:variable name="image" value="{teaserImage}"/> <f:then>
</f:then> <f:variable name="image" value="{teaserImage}"/>
<f:else> </f:then>
<f:variable name="image" value="{defaultImage}"/> <f:else>
</f:else> <f:variable name="image" value="{defaultImage}"/>
</f:if> </f:else>
<f:if condition="{image}"> </f:if>
<f:then> <f:if condition="{image}">
<ep:lazyLoadImage image="{image}" <f:then>
loaderimg="EXT:ep_theme/Resources/Public/images/lazy.png" <ep:lazyLoadImage image="{image}"
class="block w-full h-full object-cover" loaderimg="EXT:ep_theme/Resources/Public/images/lazy.png"
width="400c" class="block w-full h-full object-cover"
height="300c" width="400c"
alt="{concept.name}" /> height="300c"
</f:then> alt="{concept.name}" />
<f:else> </f:then>
<f:image src="EXT:ep_theme/Resources/Public/images/lazy.png" <f:else>
width="400c" <f:image src="EXT:ep_theme/Resources/Public/images/lazy.png"
height="300c" width="400c"
alt="{concept.name}"/> height="300c"
</f:else> alt="{concept.name}"/>
</f:if> </f:else>
</f:alias> </f:if>
<div class="absolute top-0 left-0 inset-0 bg-concept-{concept.code}-overlay"> </f:alias>
<div class="flex h-full w-full p-4 items-end headline--3 text-white"> <div class="absolute top-0 left-0 inset-0 bg-concept-{concept.code}-overlay">
{concept.name} <div class="flex h-full w-full p-4 items-end headline--3 text-white">
{concept.name}
</div>
</div> </div>
</div> </div>
</div> <div class="p-4 flex-1">
<div class="p-4 flex-1"> {concept.teaser -> f:format.crop(maxCharacters: settings.teaserTextMaxChars) -> f:format.html()}
{concept.teaser -> f:format.crop(maxCharacters: settings.teaserTextMaxChars) -> f:format.html()} </div>
</div> <div class="bg-concept-{concept.code} h-1 w-20"></div>
<div class="bg-concept-{concept.code} h-1 w-20"></div> </a>
</a> </f:if>
</f:section> </f:section>
</html> </html>