Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement EXT:news #148

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"prefer-stable": true,
"require": {
"php": "^8.2",
"georgringer/news": "dev-12-13",
"surfcamp-team4/football": "@dev",
"typo3/cms-backend": "dev-main",
"typo3/cms-belog": "dev-main",
Expand Down
105 changes: 103 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions config/system/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@
'useMysqlFulltext' => '0',
'xlhtml' => '/usr/bin/',
],
'news' => [
'advancedMediaPreview' => '1',
'archiveDate' => 'date',
'categoryBeGroupTceFormsRestriction' => '0',
'categoryRestriction' => '',
'contentElementRelation' => '1',
'dateTimeNotRequired' => '0',
'hidePageTreeForAdministrationModule' => '0',
'manualSorting' => '0',
'prependAtCopy' => '1',
'resourceFolderImporter' => '/news_import',
'rteForTeaser' => '0',
'showAdministrationModule' => '1',
'slugBehaviour' => 'unique',
'storageUidImporter' => '1',
'tagPid' => '1',
],
'scheduler' => [
'maxLifetime' => '1440',
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@import 'EXT:news/Configuration/TypoScript/setup.typoscript'

plugin.tx_news {
view {
templateRootPaths {
100 = EXT:football/Resources/Private/Templates/Extensions/News/Templates
}
partialRootPaths {
100 = EXT:football/Resources/Private/Templates/Extensions/News/Partials
}
layoutRootPaths {
100 = EXT:football/Resources/Private/Templates/Extensions/News/Layouts
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'EXT:news/Configuration/TypoScript/constants.typoscript'

############
### PAGE ###
############
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
@import './TypoScript/Page/*.typoscript'
@import './TypoScript/Helper/*.typoscript'
@import './TypoScript/ContentElements/*.typoscript'
@import './TypoScript/Extensions/*.typoscript'
@import './TypoScript/Config/*.typoscript'
@import './TypoScript/Lib/*.typoscript'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tx_news.templateLayouts {
100 = Teaser list
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TCEFORM.tt_content {
CType.keepItems = game_results,textmedia,cta,hero,sponsors,form_formframework,event_teaser,news_teaser,indexedsearch_pi2,persons_overview
CType.keepItems = game_results,textmedia,cta,hero,sponsors,form_formframework,event_teaser,news_teaser,indexedsearch_pi2,persons_overview,news_pi1,news_newsdetail

header_layout {
keepItems = 2,3,4,100
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers"
data-namespace-typo3-fluid="true">
<!--
=====================
Partials/List/Item.html
-->
<div class="article articletype-{newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}" itemscope="itemscope" itemtype="https://schema.org/Article">
<n:excludeDisplayedNews newsItem="{newsItem}"/>
<!-- header -->
<div class="header">
<h3>
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}" additionalAttributes="{itemprop:'url'}">
<span itemprop="headline">{newsItem.title}</span>
</n:link>
</h3>
</div>

<f:if condition="{newsItem.mediaPreviews}">
<!-- media preview element -->
<f:then>
<div class="news-img-wrap">
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">
<f:alias map="{mediaElement: newsItem.mediaPreviews.0}">
<f:if condition="{mediaElement.originalResource.type} == 2">
<f:image image="{mediaElement}" title="{mediaElement.originalResource.title}" alt="{mediaElement.originalResource.alternative}" loading="{settings.list.media.image.lazyLoading}" maxWidth="{f:if(condition: settings.media.maxWidth, then: settings.media.maxWidth, else: settings.list.media.image.maxWidth)}" maxHeight="{f:if(condition: settings.media.maxHeight, then: settings.media.maxHeight, else: settings.list.media.image.maxHeight)}"/>
</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}" loading="{settings.list.media.image.lazyLoading}" maxWidth="{f:if(condition: settings.media.maxWidth, then: settings.media.maxWidth, else: settings.list.media.image.maxWidth)}" maxHeight="{f:if(condition: settings.media.maxHeight, then: settings.media.maxHeight, else: settings.list.media.image.maxHeight)}"/>
</f:if>
</f:alias>
</n:link>
</div>
</f:then>
<f:else>
<f:if condition="{settings.displayDummyIfNoMedia}">
<div class="news-img-wrap">
<span class="no-media-element">
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">
<f:image src="{settings.list.media.dummyImage}" title="" alt="" loading="{settings.list.media.image.lazyLoading}" maxWidth="{f:if(condition: settings.media.maxWidth, then: settings.media.maxWidth, else: settings.list.media.image.maxWidth)}" maxHeight="{f:if(condition: settings.media.maxHeight, then: settings.media.maxHeight, else: settings.list.media.image.maxHeight)}"/>
</n:link>
</span>
</div>
</f:if>
</f:else>
</f:if>


<!-- teaser -->
<div class="teaser-text">
<n:removeMediaTags>
<f:if condition="{newsItem.teaser}">
<f:then>
<div itemprop="description">{newsItem.teaser -> f:format.crop(maxCharacters: '{settings.cropMaxCharacters}', respectWordBoundaries:'1') -> 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="more" title="{newsItem.title}">
<f:translate key="more-link"/>
</n:link>
</div>

<!-- footer information -->
<div class="footer">
<p>
<!-- date -->
<span class="news-list-date">
<time itemprop="datePublished" datetime="{f:format.date(date:newsItem.datetime, format:'Y-m-d')}">
<f:format.date format="{f:translate(key:'dateFormat')}">{newsItem.datetime}</f:format.date>
</time>
</span>

<f:if condition="{newsItem.firstCategory}">
<!-- first category -->
<span class="news-list-category">{newsItem.firstCategory.title}</span>
</f:if>

<f:if condition="{newsItem.tags}">
<!-- Tags -->
<span class="news-list-tags" itemprop="keywords">
<f:for each="{newsItem.tags}" as="tag">
{tag.title}
</f:for>
</span>
</f:if>

<!-- author -->
<f:if condition="{newsItem.author}">
<span class="news-list-author">
<f:translate key="author" arguments="{0:newsItem.author}"/>
</span>
</f:if>
</p>
</div>
</div>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers"
data-namespace-typo3-fluid="true">
<!--
=====================
Partials/List/Item.html
-->
<div class="news" itemscope="itemscope" itemtype="https://schema.org/Article">
<n:excludeDisplayedNews newsItem="{newsItem}"/>

<f:if condition="{newsItem.mediaPreviews}">
<!-- media preview element -->
<f:then>
<div class="news-img-wrap">
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">
<f:alias map="{mediaElement: newsItem.mediaPreviews.0}">
<f:if condition="{mediaElement.originalResource.type} == 2">
<f:image class="news--image" image="{mediaElement}" title="{mediaElement.originalResource.title}" alt="{mediaElement.originalResource.alternative}" loading="{settings.list.media.image.lazyLoading}" maxWidth="{f:if(condition: settings.media.maxWidth, then: settings.media.maxWidth, else: settings.list.media.image.maxWidth)}" maxHeight="{f:if(condition: settings.media.maxHeight, then: settings.media.maxHeight, else: settings.list.media.image.maxHeight)}"/>
</f:if>
<f:if condition="{mediaElement.originalResource.type} == 5">
<f:image class="news--image" image="{mediaElement}" title="{mediaElement.originalResource.title}" alt="{mediaElement.originalResource.alternative}" loading="{settings.list.media.image.lazyLoading}" maxWidth="{f:if(condition: settings.media.maxWidth, then: settings.media.maxWidth, else: settings.list.media.image.maxWidth)}" maxHeight="{f:if(condition: settings.media.maxHeight, then: settings.media.maxHeight, else: settings.list.media.image.maxHeight)}"/>
</f:if>
</f:alias>
</n:link>
</div>
</f:then>
<f:else>
<f:if condition="{settings.displayDummyIfNoMedia}">
<div class="news-img-wrap">
<span class="no-media-element">
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">
<f:image src="{settings.list.media.dummyImage}" title="" alt="" loading="{settings.list.media.image.lazyLoading}" maxWidth="{f:if(condition: settings.media.maxWidth, then: settings.media.maxWidth, else: settings.list.media.image.maxWidth)}" maxHeight="{f:if(condition: settings.media.maxHeight, then: settings.media.maxHeight, else: settings.list.media.image.maxHeight)}"/>
</n:link>
</span>
</div>
</f:if>
</f:else>
</f:if>

<p class="news--date">
<time itemprop="datePublished" datetime="{f:format.date(date:newsItem.datetime, format:'Y-m-d')}">
<f:format.date format="{f:translate(key:'dateFormat')}">{newsItem.datetime}</f:format.date>
</time>
</span>

<!-- header -->
<div class="news--title">
<h3>
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}" additionalAttributes="{itemprop:'url'}">
<span itemprop="headline">{newsItem.title}</span>
</n:link>
</h3>
</div>


<!-- teaser -->
<div class="news--description">
<n:removeMediaTags>
<f:if condition="{newsItem.teaser}">
<f:then>
<div itemprop="description">{newsItem.teaser -> f:format.crop(maxCharacters: '{settings.cropMaxCharacters}', respectWordBoundaries:'1') -> 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>
</div>

<n:link newsItem="{newsItem}" settings="{settings}" class="news--button" title="{newsItem.title}">
<f:translate key="more-link"/>
</n:link>
</div>
</html>
Loading