Wenn Sie ein Formular anlegen, müssen Sie in den Formulareinstellungen unter Template-Einstellungen das
Formulartemplate form_wrapper_zeroone
auswählen.
Desweiteren bringt das 0.1 Theme weitere Templates für Formularfelder mit, die Sie bei den jeweiligen Elementen unter Template-Einstellungen auswählen müssen, wenn die Felder wie in der Theme-Demo dargestellt werden sollen.
Checkbox-Menü:
form_checkbox_zeroone
: Darstellung untereinanderform_checkbox_inline_zeroone
: Darstellung nebeneinanderRadio-Button-Menü:
form_radio_zeroone
: Darstellung untereinanderform_radio_inline_zeroone
: Darstellung nebeneinanderAbsendefeld:
form_submit_zeroone
Wählen Sie unter Template-Einstellungen mod_login_zeroone
aus, damit das Login-Formular bereits dem Theme
entsprechend formatiert dargestellt wird.
Um das Formular nur mit Platzhaltern anzuzeigen muss das Template mod_login_placeholder_zeroone
ausgewählt werden.
Wählen Sie unter Template-Einstellungen mod_changePassword_zeroone
aus, damit das Modul bereits dem Theme
entsprechend formatiert dargestellt wird.
Wählen Sie unter Template-Einstellungen mod_lostPassword_zeroone
aus, damit das Modul bereits dem Theme
entsprechend formatiert dargestellt wird.
Wählen Sie unter Template-Einstellungen member_zeroone
oder member_grouped_zeroone
aus, damit das
Registrierungs-Formular bereits dem Theme entsprechend formatiert dargestellt wird.
Wählen Sie unter Template-Einstellungen member_zeroone
oder member_grouped_zeroone
aus, damit das
Personendaten-Formular bereits dem Theme entsprechend formatiert dargestellt wird.
Um Formularfelder in einem einfachen Formular oder Registrierungs-Formular nur mit Platzhalter ohne Labels anzuzeigen, müssen die Templates überschrieben werden. Wählen Sie in der linken Navigationsleiste unter Layouts den Menüpunkt Templates und duplizieren das entsprechende Template über den Button Neues Template.
Textfeld:
form_textfield.html5
<?php $this->extend('form_row'); ?>
<?php $this->block('field'); ?>
<?php if ($this->hasErrors()): ?>
<p class="error"><?= $this->getErrorAsString() ?></p>
<?php endif; ?>
<input type="<?= $this->type ?>" name="<?= $this->name ?>" id="ctrl_<?= $this->id ?>" class="text<?php if ($this->hideInput): ?> password<?php endif; ?><?php if ($this->class): ?> <?= $this->class ?><?php endif; ?>" value="<?= Contao\StringUtil::specialchars($this->value) ?>"<?= $this->getAttributes() ?><?php if ($this->label): ?> placeholder="<?= $this->label ?><?php if ($this->mandatory): ?> *<?php endif; ?>"<?php endif; ?>>
<?php $this->endblock(); ?>
Select-Feld:
form_select.html5
<?php $this->extend('form_row'); ?>
<?php $this->block('field'); ?>
<?php if ($this->hasErrors()): ?>
<p class="error"><?= $this->getErrorAsString() ?></p>
<?php endif; ?>
<?php if ($this->multiple): ?>
<input type="hidden" name="<?= '[]' == substr($this->name, -2) ? substr($this->name, 0, -2) : $this->name ?>" value="">
<?php endif; ?>
<select name="<?= $this->name ?>" id="ctrl_<?= $this->id ?>" class="<?= $this->class ?>"<?= $this->getAttributes() ?>>
<?php foreach ($this->getOptions() as $option): ?>
<?php if ('group_start' == $option['type']): ?>
<optgroup label="<?= $option['label'] ?>">
<?php endif; ?>
<?php if ('option' == $option['type']): ?>
<?php if($option['value'] == '') $option['label'] = $this->label; ?>
<option value="<?= $option['value'] ?>"<?= $option['selected'] ?>><?= $option['label'] ?></option>
<?php endif; ?>
<?php if ('group_end' == $option['type']): ?>
</optgroup>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php $this->endblock(); ?>
Passwort-Feld:
form_password.html5
<?php $this->extend('form_row'); ?>
<?php $this->block('field'); ?>
<?php if ($this->hasErrors()): ?>
<p class="error"><?= $this->getErrorAsString() ?></p>
<?php endif; ?>
<input type="password" name="<?= $this->name ?>" id="ctrl_<?= $this->id ?>" class="text password<?php if ($this->class): ?> <?= $this->class ?><?php endif; ?>" value="" autocomplete="new-password"<?= $this->getAttributes() ?><?php if ($this->label): ?> placeholder="<?= $this->label ?><?php if ($this->mandatory): ?> *<?php endif; ?>"<?php endif; ?>>
<?php $this->endblock(); ?>
Textarea:
form_textarea.html5
<?php $this->extend('form_row'); ?>
<?php $this->block('field'); ?>
<?php if ($this->hasErrors()): ?>
<p class="error"><?= $this->getErrorAsString() ?></p>
<?php endif; ?>
<textarea placeholder="<?= $this->label ?>" name="<?= $this->name ?>" id="ctrl_<?= $this->id ?>" class="textarea<?php if ($this->class): ?> <?= $this->class ?><?php endif; ?>" rows="<?= $this->rows ?>" cols="<?= $this->cols ?>"<?= $this->getAttributes() ?>><?= $this->value ?></textarea>
<?php $this->endblock(); ?>