ew_bloggy/Resources/Private/Templates/Post/ListRecentPosts.html
2025-01-21 20:22:57 +01:00

54 lines
1.8 KiB
HTML

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Content">
<ol class="list-articles py-4">
<f:for each="{posts}" as="post">
<f:render section="post" arguments="{_all}"/>
</f:for>
</ol>
</f:section>
<f:section name="post">
<li class="
grid
grid-cols-[9rem_auto] grid-rows-[repeat(2,auto)]
gap-x-5
border-gray-1200 border-solid
border-b last:border-none
py-4
">
<f:if condition="{post.featuredImage}">
<f:then>
<f:link.page pageUid="{post.uid}" title="{post.title}" class="row-span-full">
<img src="{f:uri.image(image: post.featuredImage, width: 140, height: 140, cropVariant: 'list')}"
alt="{post.featuredImage.alternative}"
class="w-36 h-36"/>
</f:link.page>
</f:then>
<f:else>
<div class="block w-36"></div>
</f:else>
</f:if>
<header class="row-span-auto">
<f:link.page pageUid="{post.uid}">
<f:if condition="{post.categories.0}">
<h3 class="font-montserrat text-lg">{post.categories.0.title}</h3>
</f:if>
<h2 class="font-montserrat font-bold text-xl">{post.title}</h2>
</f:link.page>
</header>
<f:if condition="{post.abstract} || {post.description}">
<div class="row-span-auto">
<f:format.html><f:format.crop maxCharacters="300" respectWordBoundaries="1"><f:if condition="{post.abstract}">
<f:then>{post.abstract}</f:then>
<f:else>{post.description}</f:else>
</f:if></f:format.crop></f:format.html>
</div>
</f:if>
</li>
</f:section>
</html>