Add backend preview renderer for booking link teaser
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace EP\EpTheme\Hooks\PageLayoutView;
|
||||
|
||||
use TYPO3\CMS\Backend\Utility\BackendUtility;
|
||||
|
||||
class TeaserBookingLinkPreviewRenderer extends AbstractPreviewRenderer
|
||||
{
|
||||
protected $cType = 'teaser_booking_link';
|
||||
|
||||
protected function getAssignmentsForTemplate(): array
|
||||
{
|
||||
$productUid = $this->data['tx_eptheme_context_product'];
|
||||
$images = $this->getImages($productUid, 'tx_epproducts_domain_model_product', 'teaser_images');
|
||||
$product = BackendUtility::getRecord('tx_epproducts_domain_model_product', $productUid);
|
||||
return [
|
||||
'images' => $images,
|
||||
'product' => $product,
|
||||
];
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
{namespace be=TYPO3\CMS\Backend\ViewHelpers}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<p>
|
||||
<strong>Teaser Buchungslink</strong>
|
||||
</p>
|
||||
<p>
|
||||
<f:if condition="{images.0}">
|
||||
<f:then>
|
||||
<f:image image="{images.0.originalFile}" width="200" height="80c" />
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:image src="EXT:ep_theme/Resources/Public/images/lazy.png" width="200" height="80c"/>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</p>
|
||||
<strong>
|
||||
{product.name}
|
||||
</strong>
|
||||
<br>
|
||||
{product.teaser -> f:format.html()}
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,6 +28,8 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['tease
|
||||
\EP\EpTheme\Hooks\PageLayoutView\TeaserConceptPreviewRenderer::class;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['teaser_product'] =
|
||||
\EP\EpTheme\Hooks\PageLayoutView\TeaserProductPreviewRenderer::class;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['teaser_booking_link'] =
|
||||
\EP\EpTheme\Hooks\PageLayoutView\TeaserBookingLinkPreviewRenderer::class;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['gmap'] =
|
||||
\EP\EpTheme\Hooks\PageLayoutView\GmapPreviewRenderer::class;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['disturber'] =
|
||||
|
||||
Reference in New Issue
Block a user