Streamline product teaser rendering

This commit is contained in:
Björn Fromme
2022-03-19 10:01:44 +01:00
parent a7f188f0f9
commit d9d7546dc5
@@ -6,18 +6,25 @@
<f:section name="Main"> <f:section name="Main">
<f:if condition="{teaser.dates}"> <f:if condition="{teaser.dates}">
<f:switch expression="{data.layout}"> <f:render partial="Product/Teaser"
<f:case value="2"> section="Teaser"
{f:variable(name: 'partial', value: 'Product/TeaserLandscape')} arguments="{
</f:case> concept: teaser.concept,
<f:case value="3"> hotel: teaser.hotel,
{f:variable(name: 'partial', value: 'Product/TeaserLandscape')} product: teaser.product,
</f:case> country: teaser.country,
<f:defaultCase> region: teaser.region,
{f:variable(name: 'partial', value: 'Product/Teaser')} productImage: teaser.product.images.original.0,
</f:defaultCase> nights: teaser.nights,
</f:switch> board: teaser.board,
<f:render partial="{partial}" section="Teaser" arguments="{teaser: teaser, slug: teaser.product.slug}"/> minPrice: teaser.minPrice,
daytrip: teaser.daytrip,
season: teaser.season,
forceHotelUid: teaser.forceHotelUid,
dateFrom: dateFrom,
dateTo: dateTo,
landscape: '{f:if(condition: \'{data.layout} == 2 || {data.layout} == 3\', then: 1, else: 0)}'
}"/>
</f:if> </f:if>
</f:section> </f:section>