Custom Element mit Bild und Akkordeon unterhalb
Hallo zusammen,
ich würde gerne ein "List" Element bauen das ein Bild enthält und unterhalb ein Akkordeon mit Toggler "Lösung anzeigen".
Das Beispiel für die Mitarbeiterliste verstehe ich soweit und konnte es auch etwas anpassen. Aber weiss jemand wie ich unter das Bildelement ein Akkordeon mit diesem Modul bekomme? Muss ich das im HTML Template von Hand um die Ausgabe setzen oder in der RSCE Config?
PHP-Code:
<?php
// rsce_my_element_config.php
return array(
'label' => array('JBZ Präparate', 'Meine Beschreibung...'),
'types' => array('content', 'module'),
'contentCategory' => 'texts',
'moduleCategory' => 'miscellaneous',
'standardFields' => array('image'),
'wrapper' => array(
'type' => 'none',
),
'fields' => array(
'headline' => array(
'inputType' => 'standardField',
'options' => array('h4'),
'eval' => array(
'mandatory' => false,
),
),
'boxes' => array(
'label' => array('Stichworte zum Präparat', ''),
'elementLabel' => '%s. Eigenschaft',
'inputType' => 'list',
'minItems' => 1,
'maxItems' => 5,
'fields' => array(
'text' => array(
'label' => array('Text2', ''),
'inputType' => 'text',
),
),
),
),
);
Und hier das Template von einem kopierten RSCE
Code:
<div class="col-12">
<div class="ce_image">
<?php $this->insert('image', $this->arrData); ?>
</div>
</div>
<div class="col-12">
<div class="ce_text noborder p-3 block">
<h4>
<?php echo $this->headline ?>
</h4>
<?php foreach ($this->boxes as $box): ?>
<ul class="list-group info">
<li class="list-group-item">
<?php echo $box->text ?>
</li>
</section>
<?php endforeach ?>
</div>
</div>
VG
Frank
Liste der Anhänge anzeigen (Anzahl: 2)
Ich will
Bild
Button Akkordeon
Bild
Button Akkordeon
Da wir Bootstrap verwenden, nutze ich dessen Akkordeon Funktionalität (Collapse). Das klappt soweit ganz gut.
Template
HTML-Code:
<div class="">
<div class="ce_image">
<?php $this->insert('image', $this->arrData); ?>
</div>
</div>
<div class="text-center">
<p>
<a class="btn btn-secondary btn-sm text-center" data-toggle="collapse" href="#<?php echo hash('ripemd160',$this->headline); ?>" role="button" aria-expanded="false" aria-controls="<?php echo hash('ripemd160',$this->headline); ?>"">
<?php echo $this->label ?>
</a>
</p>
</div>
<div class="collapse" id="<?php echo hash('ripemd160',$this->headline); ?>">
<div class="card-body">
<h2 class="text-center">
<?php echo $this->headline ?>
</h2>
<div>
<?php echo $this->info ?>
</div>
</div>
</div>
<div class="trenner"></div>
Config:
PHP-Code:
<?php
// rsce_my_element_config.php
return array(
'label' => array('Präparate', ''),
'types' => array('content', 'module'),
'contentCategory' => 'texts',
'moduleCategory' => 'miscellaneous',
'standardFields' => array('headline', 'cssID', 'image'),
'wrapper' => array(
'type' => 'none',
),
'fields' => array(
'label' => array(
'label' => array('Text auf dem Button', ''),
'inputType' => 'textarea',
),
'info' => array(
'label' => array('Infos zum Präparat', ''),
'eval' => array('rte' => 'tinyMCE', 'mandatory' => true,),
'inputType' => 'textarea',
),
),
);
Einzige unschöne Sache ist das jetzt noch in der Übersicht im Backend bei jedem Element "Präparate" steht...ich hätte dort gerne die jeweilige Headline um es besser identifizieren zu können.
Siehe Anhang