Skip to content

Instantly share code, notes, and snippets.

@Nimmermaer
Last active December 13, 2022 16:24
Show Gist options
  • Save Nimmermaer/06b77b893a71499fe9bd432c6dda7efa to your computer and use it in GitHub Desktop.
Save Nimmermaer/06b77b893a71499fe9bd432c6dda7efa to your computer and use it in GitHub Desktop.
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