madeyourday/contao-rocksolid-custom-elements
Repository auf Github
Bundle auf packagist
Eigene Inhaltselemente für Contao erstellen
| Contao-Version | aktiv in |
|---|---|
| 4.4 | akaziaverlag.at, moosmann-planung.at |
Info auf www.rocksolidthemes.com
PCT Custom Elements, DMA-Element-Generator
Eigene Elemente erstellen im Ordner /templates:
1. Konfigurationsdatei rsce_meinElement.config.php
<?php
// rsce_meinElement_config.php
return array(
...
)
?>
Um die Konfigurationsdatei im Backend bearbeiten zu können, muss php in den Einstellungen als unterstütztes Templateformat eingetragen werden!
Eine Vorlage liegt unter C:\laragon\www.\rw\templates: rsce_test_config.php
Die contentCategory und moduleCategory sind in der config.php in den Abschnitten // Front end modules $GLOBALS['FE_MOD'] bzw. Content elements $GLOBALS['TL_CTE'] ersichtlich.
2. Template-Datei rsce_meinElement.html5
<!-- rsce_meinElement.html5 -->
<section class="<?php echo $this->class ?> block"<?php echo $this->cssID ?>>
<!--?php echo $this->showTemplateVars(); ?-->
<header>
<<?php echo $this->hl ?>>
<?php echo $this->headline ?>
</<?php echo $this->hl ?>>
</header>
<?php echo $this->text ?>
</section>
Felder in der Eingabemaske anordnen:
'eval' => array('tl_class' => 'w50')
| Option | Description |
|---|---|
| w50 | set the field width to 50% and float it (float: left) |
| clr | clear all floats (clear: both) |
| wizard | shorten the input field so there is room enough for the wizard button (e.g. data picker field) |
| long | make the text input field span two columns |
| m12 | add a 12px top margin to the element (used for single checkboxes) |