Append hotel category to name on detail page

This commit is contained in:
Björn Fromme
2019-07-17 09:22:38 +02:00
parent b3234be447
commit 5a828bf30a
2 changed files with 15 additions and 2 deletions
@@ -744,6 +744,18 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
return $this->category;
}
/**
* @return string
*/
public function getCategoryLabel()
{
if ($category = $this->getCategory()) {
return static::$categoryLabels[$category];
}
return null;
}
/**
* @param int $category
*/
@@ -1,7 +1,8 @@
{namespace ep=EP\EpTheme\ViewHelpers}
<f:variable name="hotelTitle">{hotel.name -> f:format.raw()}{f:if(condition: hotel.categoryLabel, then: ' ({hotel.categoryLabel -> f:format.raw()})')}</f:variable>
<f:if condition="{bars}">
<f:then><div class="ep-headbar">{hotel.name -> f:format.raw()}</div></f:then>
<f:else><h2>{hotel.name -> f:format.raw()}</h2></f:else>
<f:then><div class="ep-headbar">{hotelTitle}</div></f:then>
<f:else><h2>{hotelTitle}</h2></f:else>
</f:if>
<div class="hotel-details hotel-details--description">
{hotel.description -> f:format.html()}