PHP-Code:
<?php
return array(
'label' => array('SLIDER TEST', ''),
'types' => array('content'),
/*'standardFields' => array('cssID'), */
'fields' => array(
'boxes' => array(
'label' => array('Textboxen', ''),
'elementLabel' => '%s. Box',
'inputType' => 'list',
'minItems' => 1,
/*'maxItems' => 4,*/
'fields' => array(
'multiSRC' => array(
'label' => array('Bild', 'Teaserbild'),
'inputType' => 'fileTree',
'eval' => array( 'tl_class' => 'clr',
'isGallery' => true,
'multiple' => true,
'fieldType' => 'checkbox',
'orderField' => 'orderSRC',
'files' => true,
'mandatory' => true,
'extensions' => \Config::get('validImageTypes') ),
),
'headline' => array(
'label' => array('Überschrift', ''),
'eval' => array('mandatory'=>false,'tl_class' => 'clr'),
'inputType' => 'text',
),
'teasertext' => array(
'label' => array('Teaser Text', 'Text für den Teaser hier eingeben'),
'eval' => array('mandatory'=>false, 'rte' => 'tinyMCE', 'tl_class' => 'clr'),
'inputType' => 'textarea',
),
'link' => array(
'label' => array('Link Adresse', ''),
'eval' => array('rgxp'=>'url', 'decodeEntities'=>true,'maxlength'=>250,'mandatory'=>false,'tl_class' => 'w50 clr'),
'inputType' => 'url',
),
'linktext' => array(
'label' => array('Link Text', 'Text für den Link - "mehr" kann überschrieben werden'),
'eval' => array('mandatory'=>false,'tl_class' => 'w50 clr'),
'inputType' => 'text',
'default' => 'mehr',
),
'link_target' => array(
'label' => $GLOBALS['TL_LANG']['MSC']['target'],
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 clr'),
),
'bgcolor' => array(
'label' => array('Hintergrundfarbe Textbereich', 'HG Farbe der Teaser-Textbox'),
'eval' => array('mandatory'=>false,'tl_class' => 'w50 clr'),
'default' => 'area--gray',
'options' => array(
'area--gray' => 'Grau',
'area--white' => 'Weiß',
),
'inputType' => 'radio',
),
),
),
),
);
PHP-Code:
<?php
if (TL_MODE === 'BE') {
foreach ($this->boxes as $box)
echo ''.$box->headline.'<br>';
return;
}
?>
<div class="teaser__box--full mb-5">
<?php foreach($this->boxes as $box): ?>
<div class="row teaser no-gutters">
<div class="col-md-6 order-md-1 order-2">
<div class="teaser-area d-flex justify-content-center align-items-center <?= $box->bgcolor ?>">
<div class="teaser-text--inner">
<?php if ($box->headline): ?><h2><?= $box->headline ?></h2><?php endif ?>
<?php if ($box->teasertext): ?><?= $box->teasertext ?><?php endif ?>
<?php if ($box->link): ?>
<div class="teaser-area-link block">
<a href="<?= $box->link ?>" title="<?= $box->linktext ?>" <?php if ($box->link_target): ?> target="_blank"<?php endif ?>><?= $box->linktext ?></a>
</div>
<?php endif ?>
</div>
</div>
</div>
<div class="col-md-6 order-md-2 order-1">
<div class="teaser-image h-100 h-100-img object-fit-cover">
<?php if ($box->link): ?><a href="<?= $box->link ?>" title="<?= $box->linktext ?>" <?php if ($box->link_target): ?> target="_blank"<?php endif ?>><?php endif ?>
<div class="mpslider">
<?php
$dataSorted = array_map('\StringUtil::binToUuid', deserialize($box->orderSRC, true));
foreach ( $dataSorted as $data ):
if ($image = $this->getImageObject($data, array('','', 13))):
$this->insert('picture_default', $image->picture);
endif;
endforeach ?>
</div>
<?php if ($box->link): ?></a><?php endif ?>
</div>
</div>
</div>
<?php endforeach ?>
</div>
Nicht wundern über Sinn und Zweck, das Ganze ist noch im Aufbau aber Bilder müssten dennoch ausgegeben werden