I have extended and adjusted the flexform of ext:form like described here:
ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']
['SC_OPTIONS']
[\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]
['flexParsing']
[] = \Vendor\ExtKey\Hooks\FlexFormHook::class;
Classes/Hooks/FlexFormHook.php:
<?php
namespace Vendor\ExtKey\Hooks;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class FlexFormHook
{
/**
* @param array $dataStructure
* @param array $identifier
* @return array
*/
public function parseDataStructureByIdentifierPostProcess(array $dataStructure, array $identifier): array
{
if ($identifier['type'] === 'tca' && $identifier['tableName'] === 'tt_content' && $identifier['dataStructureKey'] === '*,form_formframework') {
$file = Environment::getPublicPath() . '/typo3conf/ext/extKey/Configuration/Example.xml';
$content = file_get_contents($file);
if ($content) {
$dataStructure['sheets']['extraEntry'] = GeneralUtility::xml2array($content);
}
}
return $dataStructure;
}
}
Flexform:
<extra>
<ROOT>
<TCEforms>
<sheetTitle>Fo</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.postsPerPage>
<TCEforms>
<label>Max. number of posts to display per page</label>
<config>
<type>input</type>
<size>2</size>
<eval>int</eval>
<default>3</default>
</config>
</TCEforms>
</settings.postsPerPage>
</el>
</ROOT>
</extra>
Now I am able to set custom settings for a form and there is no need to double the YAML-configuration of the form, so far the theory.
BUT:
I can not access the settings with {settings.postsPerPage} in the templates nor I am able to get them in a custom finisher.
Is it somehow possible to get my custom settings in the template of ext:form and in my custom finisher? If so, how?