Commit 0dcc1acd authored by Jonas Götze's avatar Jonas Götze

[FEATURE] Enable multiple Authors for news in list view

parent 5991ad87
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers"
xmlns:t3o="http://typo3.org/ns/T3o/T3olayout/ViewHelpers" data-namespace-typo3-fluid="true">
<!--
=====================
Partials/List/Item.html
-->
<f:variable name="breakpoints" value="{
0:{media:'max-width', size:375, maxWidth:375, cropVariant:'mobilenews'},
1:{media:'max-width', size:480, maxWidth:480, cropVariant:'mobilenews'},
2:{media:'max-width', size:767, maxWidth:510, cropVariant:'tabletnews'},
3:{media:'max-width', size:991, maxWidth:300, cropVariant:'tabletnews'},
4:{media:'max-width', size:1199, maxWidth:360, cropVariant:'desktopnews'},
5:{media:'min-width', size:1200, maxWidth:360, cropVariant:'desktopnews'}
}" />
<div class="article articletype-{newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')} news-list__item py-3"
data-category="{newsItem.firstCategory.title}"
data-datetime="{f:format.date(date:newsItem.datetime, format:'Y-m-d')}"
itemscope="itemscope"
itemtype="http://schema.org/Article">
<n:excludeDisplayedNews newsItem="{newsItem}" />
<div class="media">
<!-- media preview element -->
<f:if condition="{newsItem.mediaPreviews}">
<f:then>
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}" class="news-media__preview">
<f:alias map="{mediaElement: '{newsItem.mediaPreviews.0}'}">
<f:if condition="{mediaElement.originalResource.type} == 2">
<f:render partial="ContentElements/Media/Rendering/PictureSrcsetCols" section="ImageRender" arguments="{file: mediaElement, breakpoints: breakpoints}" />
</f:if>
<f:if condition="{mediaElement.originalResource.type} == 4">
<f:render partial="Detail/MediaVideo" arguments="{mediaElement: mediaElement}" />
</f:if>
<f:if condition="{mediaElement.originalResource.type} == 5">
<f:image image="{mediaElement}"
title="{mediaElement.originalResource.title}"
alt="{mediaElement.originalResource.alternative}"
width="{settings.list.media.image.width}"
height="{settings.list.media.image.height}"
class="img-fluid" />
</f:if>
</f:alias>
</n:link>
</f:then>
<f:else>
<f:if condition="{settings.displayDummyIfNoMedia}">
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}" class="news-media__no-image">
<f:if condition="{newsItem.defaultImage}">
<f:then>
<f:variable name="imageSrc" value="typo3conf/ext/t3org_layout/Resources/Public/Images/NewsDefaultImages/{newsItem.defaultImage}" />
<f:image src="{imageSrc}" title="" alt="" width="540" height="360c" class="img-fluid" />
</f:then>
<f:else>
<f:image src="{settings.list.media.dummyImage}" title="" alt="" width="540" height="360c" class="img-fluid" />
</f:else>
</f:if>
</n:link>
</f:if>
</f:else>
</f:if>
<div class="media-body">
<!-- date -->
<span class="news-list__item-date small">
<time datetime="{f:format.date(date:newsItem.datetime, format:'Y-m-d')}">
<f:format.date format="D. jS F, Y">{newsItem.datetime}</f:format.date>
<meta itemprop="datePublished" content="{f:format.date(date:newsItem.datetime, format:'Y-m-d')}" />
</time>
</span>
<h2 class="mt-md-3 mb-0">
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">{newsItem.title}</n:link>
</h2>
<!-- Categories -->
<f:if condition="{newsItem.categories -> f:count()} > 0">
<div class="news-list__item-categories d-block small">
<span>
<f:translate key="categories" />
:
</span>
<f:for each="{newsItem.categories}" as="category" iteration="iterator">
<span>{category.title}
<f:if condition="{iterator.isLast} == false">,</f:if>
</span>
</f:for>
</div>
</f:if>
<!-- Tags -->
<f:if condition="{newsItem.tags -> f:count()} > 0">
<div class="news-list__item-tags d-block small">
<f:for each="{newsItem.tags}" as="tag" iteration="iterator">
<span><i class="fas fa-tag mr-1" aria-hidden="true"></i>{tag.title}
<f:if condition="{iterator.isLast} == false">,</f:if>
</span>
</f:for>
</div>
</f:if>
<!-- author -->
<f:if condition="{newsItem.authorFeUser -> f:count()} > 0">
<f:then>
<span class="news-list__item-author d-block small">
<f:translate key="author" arguments="{0:dd.authorFeUser.name}" />
<f:for each="{newsItem.authorFeUser}" as="authorFeUser" iteration="authorFeUserIterator">
<f:if condition="{authorFeUserIterator.isFirst} === false">
<f:if condition="{authorFeUserIterator.isLast} === true">
<f:then>
and
</f:then>
<f:else>
,
</f:else>
</f:if>
</f:if>
{authorFeUser.name}
</f:for>
</span>
</f:then>
<f:else>
<f:if condition="{newsItem.author}">
<span class="news-list__item-author d-block small">
<f:translate key="author" arguments="{0:dd.author}" />
{newsItem.author}
</span>
</f:if>
</f:else>
</f:if>
<div class="mt-3 mt-lg-4 small">
<n:removeMediaTags>
<f:if condition="{newsItem.teaser}">
<f:then>
<div itemprop="description">{newsItem.teaser -> f:format.html()}</div>
</f:then>
<f:else>
<div itemprop="description">{newsItem.bodytext -> f:format.crop(maxCharacters: '{settings.cropMaxCharacters}', respectWordBoundaries:'1') -> f:format.html()}</div>
</f:else>
</f:if>
</n:removeMediaTags>
<n:link newsItem="{newsItem}" settings="{settings}" class="btn btn-secondary" title="{newsItem.title}">
<f:translate key="more-link" />
</n:link>
</div>
</div>
</div>
</div>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment