Hallo,
ich habe mir eine Erweiterung geschrieben, um bei Formularen eine alternative Weiterleitungsseite innerhalb des Artikels festzulegen. Soweit so gut, im Backend funktioniert auch alles. Nur im Frontend erscheint bei mir keine Ausgabe, und das obwohl ich das Template bereits angepasst habe und um mein Feld erweitert ist.
dca/tl_content.php
PHP-Code:
<?php
$GLOBALS['TL_DCA']['tl_content']['palettes']['form'] = str_replace('space;', 'space;{cfr_legend},cfr;', $GLOBALS['TL_DCA']['tl_content']['palettes']['form']);
$GLOBALS['TL_DCA']['tl_content']['fields']['cfr'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['cfr'],
'inputType' => 'pageTree',
'exclude' => true,
'eval' => array('mandatory'=>false, 'fieldType'=>'radio'),
'sql' => "int(10) unsigned NOT NULL default '0'",
);
config/autoload.php
PHP-Code:
<?php
/**
* Register the templates
**/
TemplateLoader::addFiles(array
(
'form' => 'system/modules/customformredirect/templates',
));
config/autoload.ini
PHP-Code:
;;
; List modules which are required to be loaded beforehand
;;
requires[] = "core"
;;
; Configure what you want the autoload creator to register
;;
register_namespaces = false
register_classes = false
register_templates = true
;;
; Override the default configuration for certain sub directories
;;
[vendor/*]
register_namespaces = false
register_classes = false
register_templates = false
templates/form.html5 (natürlich auch im templates ordner generiert)
(das mit $action ist nur suboptimale Lösung, da ich ungern die CSS-ID des Formular dafür zweckentfremden will)
PHP-Code:
<!-- indexer::stop -->
<div class="<?php echo $this->class; ?> <?php echo $this->tableless ? 'tableless' : 'tableform'; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
<?php endif; ?>
<?php $action = (!empty($this->cssID)) ? filter_var($this->cssID, FILTER_SANITIZE_NUMBER_INT) : $this->action; ?>
<!-- <?php echo $action . ": " . $this->replaceInserttags('{{link_url::' . $action . '}}'); ?> -->
CFR: <?php echo $this->cfr; ?>
<form<?php if ($this->action): ?> action="<?php echo $this->replaceInsertTags('{{link_url::' . $action . '}}'); ?>"<?php endif; ?> id="<?php echo $this->formId; ?>" method="<?php echo $this->method; ?>" enctype="<?php echo $this->enctype; ?>"<?php echo $this->attributes; ?><?php echo $this->novalidate; ?>>
<div class="formbody">
<?php if ($this->method != 'get'): ?>
<input type="hidden" name="FORM_SUBMIT" value="<?php echo $this->formSubmit; ?>">
<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}">
<?php if ($this->maxFileSize): ?>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $this->maxFileSize; ?>">
<?php endif; ?>
<?php endif; ?>
<?php echo $this->hidden; ?>
<?php if (!$this->tableless): ?>
<table>
<?php echo $this->fields; ?>
</table>
<?php else: ?>
<?php echo $this->fields; ?>
<?php endif; ?>
</div>
</form>
</div>
<!-- indexer::continue -->
languages/de/default.php
PHP-Code:
<?php
$GLOBALS['TL_LANG']['tl_content']['cfr'][0] = 'Weiterleitungsseite';
$GLOBALS['TL_LANG']['tl_content']['cfr'][1] = 'Benutzerdefinierte Weiterleitungsseite festlegen (überschreibt die in den Formular-Einstellungen angegebene Weiterleitungsseite)';
$GLOBALS['TL_LANG']['tl_content']['cfr_legend'] = 'Weiterleitung';
Lesezeichen