-
-
Save Nimmermaer/06b77b893a71499fe9bd432c6dda7efa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyVendor\Project\Form\Element; | |
use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; | |
class StaticTextElement extends AbstractFormElement | |
{ | |
/** | |
* @inheritDoc | |
*/ | |
public function render() | |
{ | |
$text = $this->data['parameterArray']['fieldConf']['config']['parameters']['statictext']; | |
$result = $this->initializeResultArray(); | |
$result['html'] = <<<HTML | |
<fieldset> | |
<div class="row"> | |
<p>{$text}</p> | |
</fieldset> | |
HTML; | |
return $result; | |
} | |
} | |
_------ localconf ----- | |
/*************** | |
* FormEngine | |
*/ | |
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1665610537] = [ | |
'nodeName' => 'staticTextElement', | |
'priority' => 40, | |
'class' => \Iwm\Project\Form\Element\StaticTextElement::class, | |
]; | |
---+TCA----- | |
'tx_newsletter_hint' => [ | |
'exclude' => 1, | |
'label' => '', | |
'displayCond' => [ | |
'AND' => | |
[ | |
'FIELD:CType:=:list', | |
'FIELD:list_type:=:plugin_newsletter' | |
], | |
], | |
'config' => [ | |
'type' => 'user', | |
'renderType' => 'staticTextElement', | |
'parameters' => [ | |
'statictext' => 'Bitte bei der Pflege beachten, dass [.. | |
]', | |
], | |
], | |
], | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment