Fix weird link rendering in content teasers

This commit is contained in:
Björn Fromme
2021-08-18 16:21:02 +02:00
parent 0be0b484ed
commit b9de11315a
2 changed files with 37 additions and 59 deletions
@@ -1,40 +1,30 @@
<html data-namespace-typo3-fluid="true" lang="en" <html data-namespace-typo3-fluid="true" lang="en"
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"> xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:section name="Teaser"> <f:section name="Teaser">
<f:if condition="{data.header_link}"> <f:link.typolink parameter="{data.header_link}"
<v:condition.string.isNumeric value="{data.header_link}"> class="teaserbox teaserbox--default">
<f:then> <div class="teaserbox__image">
<f:link.typolink parameter="{data.header_link}" title="{data.header}" class="teaserbox teaserbox--default"> <f:if condition="{context.country}">
<f:render section="Content" arguments="{_all}"/> <f:image class="teaserbox__flag"
</f:link.typolink> src="{ep:flagiconSource(country: context.country)}"
</f:then> alt="{context.country.name}"/>
<f:else> </f:if>
<a href="{data.header_link}" target="_blank" title="{data.header}" class="teaserbox teaserbox--default"> <f:render partial="TeaserImage" arguments="{image: teaserImage}"/>
<f:render section="Content" arguments="{_all}"/> </div>
</a> <div class="teaserbox__main" data-rte-content>
</f:else> <span class="headline headline--3 headline--teaser">
</v:condition.string.isNumeric> {data.header -> f:format.nl2br()}{f:if(condition: data.subheader, then: '<br>{data.subheader}')}
</f:if> </span>
</f:section> <hr>
{data.bodytext -> f:format.html()}
<f:section name="Content"> </div>
<div class="teaserbox__image"> <button class="button w-full">
<f:if condition="{context.country}"> {data.button -> v:or(alternative: 'Details')}
<f:image class="teaserbox__flag" </button>
src="{ep:flagiconSource(country: context.country)}" alt="{context.country.name}"/> </f:link.typolink>
</f:if>
<f:render partial="TeaserImage" arguments="{image: teaserImage}"/>
</div>
<div class="teaserbox__main" data-rte-content>
<span class="headline headline--3 headline--teaser">{data.header -> f:format.nl2br()}{f:if(condition: data.subheader, then: '<br>{data.subheader}')}</span>
<hr>
{data.bodytext -> f:format.html()}
</div>
<button class="button button--full">{data.button -> v:or(alternative: 'Details')}</button>
</f:section> </f:section>
</html> </html>
@@ -3,35 +3,23 @@
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"> xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:layout name="Default"/>
<f:section name="Teaser"> <f:section name="Teaser">
<f:if condition="{data.header_link}"> <f:link.typolink parameter="{data.header_link}"
<v:condition.string.isNumeric value="{data.header_link}"> class="teaserbox teaserbox--default">
<f:then> <div class="teasebox__image">
<f:link.typolink parameter="{data.header_link}" title="{data.header}" class="teaserbox teaserbox--default"> <f:render partial="TeaserImage" arguments="{image: teaserImage}"/>
<f:render section="Content" arguments="{_all}"/> </div>
</f:link.typolink> <div class="teaserbox__main" data-rte-content>
</f:then> <span class="headline headline--3 headline--teaser">
<f:else> {data.header -> f:format.nl2br()}{f:if(condition: data.subheader, then: '<br>{data.subheader}')}
<a href="{data.header_link}" target="_blank" title="{data.header}" class="teaserbox teaserbox--default"> </span>
<f:render section="Content" arguments="{_all}"/> <hr>
</a> {data.bodytext -> f:format.html()}
</f:else> </div>
</v:condition.string.isNumeric> <button class="button button--full">
</f:if> {data.button -> v:or(alternative: 'Details')}
</f:section> </button>
</f:link.typolink>
<f:section name="Content">
<div class="teasebox__image">
<f:render partial="TeaserImage" arguments="{image: teaserImage}"/>
</div>
<div class="teaserbox__main" data-rte-content>
<span class="headline headline--3 headline--teaser">{data.header -> f:format.nl2br()}{f:if(condition: data.subheader, then: '<br>{data.subheader}')}</span>
<hr>
{data.bodytext -> f:format.html()}
</div>
<button class="button button--full">{data.button -> v:or(alternative: 'Details')}</button>
</f:section> </f:section>
</html> </html>