diff --git a/Configuration/TypoScript/Frontend/constants.typoscript b/Configuration/TypoScript/Frontend/constants.typoscript index 34a9c4da599228c1cc1b6f3069b7b9a49eab04db..056a6f06563356824bebc02b2bd764d182a6d6d9 100644 --- a/Configuration/TypoScript/Frontend/constants.typoscript +++ b/Configuration/TypoScript/Frontend/constants.typoscript @@ -19,5 +19,8 @@ plugin.tx_sgnews { # sort direction (DESC / ASC) sortDirection = DESC + + # This enables the output of related news in regards to the news category or tags + enableAutomaticRelatedNews = 1 } } diff --git a/Configuration/TypoScript/Frontend/setup.typoscript b/Configuration/TypoScript/Frontend/setup.typoscript index 9a52fd4ef64e299d3c2fd12ce028ac75c9ebbf6a..fb32038793c9f09240980a30d131cdea7f83f512 100644 --- a/Configuration/TypoScript/Frontend/setup.typoscript +++ b/Configuration/TypoScript/Frontend/setup.typoscript @@ -109,6 +109,9 @@ plugin.tx_sgnews { # The logo value for the structured data implementation (see single view template) publisherLogo = + + # This enables the output of related news in regards to the news category or tags + enableAutomaticRelatedNews = {$plugin.tx_sgnews.settings.enableAutomaticRelatedNews} } features { diff --git a/Resources/Private/Templates/SingleView/SingleView.html b/Resources/Private/Templates/SingleView/SingleView.html index 1f2888270b7b5ca96d30b2d7ca9d7abfd08e4dbb..485bcc8336512b54f606db299edfd667c1daefe3 100644 --- a/Resources/Private/Templates/SingleView/SingleView.html +++ b/Resources/Private/Templates/SingleView/SingleView.html @@ -88,8 +88,8 @@ </div> </div> </section> - </div> + <section class="content"> <div class="container"> <div class="tx-sgnews-single"> @@ -216,26 +216,31 @@ </div> </f:then> <f:else> - <sg:related news="{newsMetaData.news}" iteration="iterator" limit="5" as="relatedNewsEntry"> - <f:if condition="{iterator.isFirst}"> - <div class="tx-sgnews-single-related"> - <h3> - <f:translate key="frontend.singleview.relatedArticles"/> - </h3> - <ul class="tx-sgnews-list tx-sgnews-overview"> - </f:if> - <li class="col-md-4 col-sm-6 col-xs-12"> - <f:render partial="TeaserRelated" arguments="{ - news: relatedNewsEntry, - headerTag: '<h2>', - closingHeaderTag: '</h2>' - }" /> - </li> - <f:if condition="{iterator.isLast}"> - </ul> - </div> - </f:if> - </sg:related> + <f:if condition="{settings.enableAutomaticRelatedNews}"> + <sg:related news="{newsMetaData.news}" + iteration="iterator" + limit="5" + as="relatedNewsEntry"> + <f:if condition="{iterator.isFirst}"> + <div class="tx-sgnews-single-related"> + <h3> + <f:translate key="frontend.singleview.relatedArticles"/> + </h3> + <ul class="tx-sgnews-list tx-sgnews-overview"> + </f:if> + <li class="col-md-4 col-sm-6 col-xs-12"> + <f:render partial="TeaserRelated" arguments="{ + news: relatedNewsEntry, + headerTag: '<h2>', + closingHeaderTag: '</h2>' + }" /> + </li> + <f:if condition="{iterator.isLast}"> + </ul> + </div> + </f:if> + </sg:related> + </f:if> </f:else> </f:if> </div>