Implement teaser for booking links

This commit is contained in:
Björn Fromme
2019-10-11 22:08:31 +02:00
parent 11363b85bf
commit f241fcba9b
11 changed files with 85 additions and 12 deletions
@@ -21,12 +21,13 @@
</f:link.action>
</f:then>
<f:else>
<f:link.typolink
parameter="{teaser.product.detailPage}"
class="teaserbox__flip"
title="{teaser.product.name}">
<f:variable name="teaserUrl" value="{f:uri.typolink(parameter: teaser.product.detailPage)}"/>
<f:if condition="{slug}">
<f:variable name="teaserUrl" value="{teaserUrl}{slug}/"/>
</f:if>
<a href="{teaserUrl}" class="teaserbox__flip" title="{teaser.product.name}">
<f:render section="Inner" arguments="{_all}"/>
</f:link.typolink>
</a>
</f:else>
</f:if>
</div>
@@ -7,10 +7,13 @@
<f:section name="Teaser">
<f:if condition="{teaser.forceHotelUid}">
<f:then>
<v:variable.set name="uriLink" value="{f:uri.action(pageUid: teaser.product.detailPage, action: 'detail', controller: 'Product', arguments: '{product: teaser.product.uid, hotel: teaser.hotel.uid}', extensionName: 'epproducts', pluginName: 'product_detail')}"/>
<f:variable name="teaserUrl" value="{f:uri.action(pageUid: teaser.product.detailPage, action: 'detail', controller: 'Product', arguments: '{product: teaser.product.uid, hotel: teaser.hotel.uid}', extensionName: 'epproducts', pluginName: 'product_detail')}"/>
</f:then>
<f:else>
<v:variable.set name="uriLink" value="{f:uri.typolink(parameter: teaser.product.detailPage)}"/>
<f:variable name="teaserUrl" value="{f:uri.typolink(parameter: teaser.product.detailPage)}"/>
<f:if condition="{slug}">
<f:variable name="teaserUrl" value="{teaserUrl}{slug}/"/>
</f:if>
</f:else>
</f:if>
<f:render section="Inner" arguments="{_all}"/>
@@ -22,7 +25,7 @@
<img class="teaserbox__flag"
src="{teaser.country.flag}"
alt="{teaser.country.name}"/>
<a href="{uriLink}" title="{teaser.product.name}">
<a href="{teaserUrl}" title="{teaser.product.name}">
<f:render section="Image" arguments="{_all}"/>
</a>
<f:if condition="{teaser.concept.code}">
@@ -80,7 +83,7 @@
<span class="searchresult-item__label">{f:if(condition: '{teaser.dates -> f:count()} > 1', then: 'Zeitraum', else: 'Termin')}</span>
<span class="searchresult-item__daterange">{ep:dateRange(dateFrom: teaser.minDateStart, dateTo: teaser.maxDateEnd, includeLabel: 0)}</span>
<f:if condition="{teaser.dates -> f:count()} > 1 && !{teaser.daytrip}">
<a href="{uriLink}" title="Alle Termine {teaser.product.name}">
<a href="{teaserUrl}" title="Alle Termine {teaser.product.name}">
<span class="searchresult-item__daterange">
<i class="fa fa-arrow-circle-right"></i> {teaser.dates -> f:count()} Termin{f:if(condition: '{teaser.dates -> f:count()} > 1', then: 'e')}
</span>
@@ -91,7 +94,7 @@
</div>
<div class="teaserbox__aside__bottom">
<span class="searchresult-item__price">ab {teaser.minPrice} €{f:if(condition: teaser.pseudoPrice, then: ' <s class="searchresult-item__pseudo-price">{teaser.pseudoPrice} €</s>')}</span>
<a href="{uriLink}" title="{teaser.product.name}" class="button button--full searchresult-item__button">Details &amp; Buchen</a>
<a href="{teaserUrl}" title="{teaser.product.name}" class="button button--full searchresult-item__button">Details &amp; Buchen</a>
</div>
</div>
<watchlist-toggle uid="{teaser.key}" class="teaserbox-watchlist"></watchlist-toggle>
@@ -0,0 +1,24 @@
<html data-namespace-typo3-fluid="true" lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:layout name="Default"/>
<f:section name="Main">
<f:if condition="{teaser.dates}">
<f:switch expression="{data.layout}">
<f:case value="2">
{f:variable(name: 'partial', value: 'Product/TeaserWide')}
</f:case>
<f:case value="3">
{f:variable(name: 'partial', value: 'Product/TeaserWide')}
</f:case>
<f:defaultCase>
{f:variable(name: 'partial', value: 'Product/Teaser')}
</f:defaultCase>
</f:switch>
<f:render partial="{partial}" section="Teaser" arguments="{teaser: teaser, slug: teaser.product.slug}"/>
</f:if>
</f:section>
</html>