- Extend
\FluidTYPO3\Flux\Form\Field\Text
class Text extends \FluidTYPO3\Flux\Form\Field\Text
{
/**
* @var string
*/
protected $richtextConfiguration;
public function buildConfiguration()
{
$configuration = parent::buildConfiguration();
if(true === $this->getEnableRichText()) {
$configuration['richtextConfiguration'] = $this->getRichtextConfiguration();
$configuration['defaultExtras'] = '';
}
return $configuration;
}
/**
* @return integer
*/
public function getRichtextConfiguration()
{
return $this->richtextConfiguration;
}
/**
* @param string $richtextConfiguration
* @return Text
*/
public function setRichtextConfiguration($richtextConfiguration)
{
$this->richtextConfiguration = $richtextConfiguration;
return $this;
}
}
- Extend
\FluidTYPO3\Flux\ViewHelpers\Field\TextViewHelper
class TextViewHelper extends \FluidTYPO3\Flux\ViewHelpers\Field\TextViewHelper {
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument(
'richtextConfiguration',
'string',
'FlexForm-syntax "richtextConfiguration" definition, example: "minimal"',
false,
'default'
);
}
/**
* @param RenderingContextInterface $renderingContext
* @param array $arguments
* @return Text
*/
public static function getComponent(RenderingContextInterface $renderingContext, array $arguments)
{
/** @var Text $text */
$text = parent::getComponent($renderingContext,$arguments);
$text->setRichtextConfiguration($arguments['richtextConfiguration']);
return $text;
}
}
- Add overrides to
ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\FluidTYPO3\Flux\Form\Field\Text::class] = ['className' => Vendor\Xclass\Field\Text::class];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\FluidTYPO3\Flux\ViewHelpers\Field\TextViewHelper::class] = ['className' => Vendor\ViewHelpers\TextViewHelper::class];
- Use
richtextConfiguration
in fluid like you would with flux >v9
<flux:field.text
name="description"
label="Description"
enableRichText="1"
richtextConfiguration="full"
/>