Skip to content
Snippets Groups Projects
Verified Commit f5e823c3 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[TASK] Add TypoScript setting to disable the automatic related news output

parent b7931a14
No related branches found
No related tags found
1 merge request!44[BUGFIX] Fix bugs with fetching the related news
...@@ -19,5 +19,8 @@ plugin.tx_sgnews { ...@@ -19,5 +19,8 @@ plugin.tx_sgnews {
# sort direction (DESC / ASC) # sort direction (DESC / ASC)
sortDirection = DESC sortDirection = DESC
# This enables the output of related news in regards to the news category or tags
enableAutomaticRelatedNews = 1
} }
} }
...@@ -109,6 +109,9 @@ plugin.tx_sgnews { ...@@ -109,6 +109,9 @@ plugin.tx_sgnews {
# The logo value for the structured data implementation (see single view template) # The logo value for the structured data implementation (see single view template)
publisherLogo = publisherLogo =
# This enables the output of related news in regards to the news category or tags
enableAutomaticRelatedNews = {$plugin.tx_sgnews.settings.enableAutomaticRelatedNews}
} }
features { features {
......
...@@ -88,8 +88,8 @@ ...@@ -88,8 +88,8 @@
</div> </div>
</div> </div>
</section> </section>
</div> </div>
<section class="content"> <section class="content">
<div class="container"> <div class="container">
<div class="tx-sgnews-single"> <div class="tx-sgnews-single">
...@@ -216,26 +216,31 @@ ...@@ -216,26 +216,31 @@
</div> </div>
</f:then> </f:then>
<f:else> <f:else>
<sg:related news="{newsMetaData.news}" iteration="iterator" limit="5" as="relatedNewsEntry"> <f:if condition="{settings.enableAutomaticRelatedNews}">
<f:if condition="{iterator.isFirst}"> <sg:related news="{newsMetaData.news}"
<div class="tx-sgnews-single-related"> iteration="iterator"
<h3> limit="5"
<f:translate key="frontend.singleview.relatedArticles"/> as="relatedNewsEntry">
</h3> <f:if condition="{iterator.isFirst}">
<ul class="tx-sgnews-list tx-sgnews-overview"> <div class="tx-sgnews-single-related">
</f:if> <h3>
<li class="col-md-4 col-sm-6 col-xs-12"> <f:translate key="frontend.singleview.relatedArticles"/>
<f:render partial="TeaserRelated" arguments="{ </h3>
news: relatedNewsEntry, <ul class="tx-sgnews-list tx-sgnews-overview">
headerTag: '<h2>', </f:if>
closingHeaderTag: '</h2>' <li class="col-md-4 col-sm-6 col-xs-12">
}" /> <f:render partial="TeaserRelated" arguments="{
</li> news: relatedNewsEntry,
<f:if condition="{iterator.isLast}"> headerTag: '<h2>',
</ul> closingHeaderTag: '</h2>'
</div> }" />
</f:if> </li>
</sg:related> <f:if condition="{iterator.isLast}">
</ul>
</div>
</f:if>
</sg:related>
</f:if>
</f:else> </f:else>
</f:if> </f:if>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment