Ich habe eine ähnliche config zusätzlich noch mit alt und title:
PHP-Code:
'image' => array(
'label' => array('Veranstaltungsbild', 'Wählen Sie ein Bild für die Veranstaltung aus.'),
'inputType' => 'fileTree',
'eval' => array(
'mandatory' => false,
'fieldType' => 'radio',
'extensions' => 'jpg,jpeg,png,gif,svg,webp',
'filesOnly' => true,
),
'tl_class' => 'veranstaltung-image',
),
'image_alt' => array(
'label' => array('Bild-Alt-Text', 'Geben Sie den Alt-Text für das Bild ein.'),
'inputType' => 'text',
'eval' => array('mandatory' => false, 'tl_class' => 'w50'),
'tl_class' => 'veranstaltung-image-alt',
'dependsOn' => 'image',
),
'image_title' => array(
'label' => array('Bild-Titel', 'Geben Sie den Titel für das Bild ein.'),
'inputType' => 'text',
'eval' => array('mandatory' => false, 'tl_class' => 'w50'),
'tl_class' => 'veranstaltung-image-title',
'dependsOn' => 'image',
),
'size' => array(
'label' => array(
'en' => array('Image width and height', ''),
'de' => array('Bildbreite und Bildhöhe', ''),
),
'inputType' => 'imageSize',
// 'options' => Contao\System::getContainer()->get('contao.image.sizes')->getAllOptions(),
'options' => \Contao\System::getContainer()->get('contao.image.sizes')->getAllOptions(),
'reference' => &$GLOBALS['TL_LANG']['MSC'],
'eval' => array(
'rgxp' => 'digit',
'includeBlankOption' => true,
'tl_class' => 'w50',
),
),
Bei mir hapert es am html5 template. Wie kann ich da die imageSize mit ausgeben?
PHP-Code:
<!-- rsce_veranstaltung.html5 -->
<?php
use Contao\FilesModel;
?>
<div class="veranstaltung col-sm-6 p-b-3">
<?php if ($this->datum_und_wochentag) { ?>
<div class="veranstaltung-datum">
<?php echo $this->datum_und_wochentag; ?>
</div>
<?php } ?>
<?php if ($this->titel) { ?>
<div class="veranstaltung-titel">
<h4><?php echo $this->titel; ?></h4>
</div>
<?php } ?>
<?php if ($this->image) { ?>
<div class="veranstaltung-image-container">
<figure class="event-image">
<img src="<?php echo \Contao\FilesModel::findByPk($this->image)->path; ?>"
alt="<?php echo $this->image_alt; ?>"
title="<?php echo $this->image_title; ?>"
class="veranstaltung-image" />
</figure>
</div>
<?php } ?>
<div class="veranstaltung-content">
<?php if ($this->beschreibung) { ?>
<div class="veranstaltung-beschreibung">
<?php echo $this->beschreibung; ?>
</div>
<?php } ?>
<?php if ($this->preis) { ?>
<div class="veranstaltung-preis">
<strong>Preis:</strong> <?php echo $this->preis; ?>
</div>
<?php } ?>
<?php if ($this->hinweis) { ?>
<div class="veranstaltung-hinweis">
<?php echo $this->hinweis; ?>
</div>
<?php } ?>
</div>
</div>
Ich hab schon einiges ausprobiert und im Forum gesucht, komme aber leider nicht zur Lösung.