从研究示例开始,我尝试为我的扩展插件创建一个可切换的控制操作,但它没有显示出来。任何人都可以帮我找出原因吗?
在我的ext_localconf.php中,我有以下内容:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'myeventplugin',
'Pi1',
[
'Events' => 'list, display'
],
// non-cacheable actions
[
'Events' => 'list, display'
]
);
在我的ext_tables.php中,我有以下内容:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'myeventplugin',
'Pi1',
'Events'
);
$pluginSignature = 'myeventplugin_Pi1';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:myeventplugin/Configuration/FlexForms/flexform_pi1.xml');
在我的Configuration / FlexForms / flexform_pi1.xml中,我有以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Events Plugin Config</sheetTitle>
</TCEforms>
<type>
array
</type>
<el>
<switchableControllerActions>
<TCEforms>
<label>View</label>
<onChange>reload</onChange>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Event List</numIndex>
<numIndex index="1">Events->list</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Event Display</numIndex>
<numIndex index="1">Events->display</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</switchableControllerActions>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
当我包含插件时,我没有看到我创建的附加选择菜单,因此我无法指定我想要它调用的操作。
我认为由于套管可能$ pluginSignature变量可能不正确。因此在ext_tables.php中尝试了以下内容:
$extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY));
$pluginSignature = $extensionName.'_'.'Pi1';
和
$extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY));
$pluginSignature = $extensionName.'_'.'pi1';
和
$pluginSignature = 'myeventplugin_Pi1';
和
$pluginSignature = 'myeventplugin_pi1';
......但仍然没有运气
我查看了我的最后一个扩展:在ext_tables.php我写道
$extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($extKey));
$pluginName = strtolower('plg');
$pluginSignature = $extensionName.'_'.$pluginName;
所以,我的情况是$ pluginSignature ='thoffer_plg',在你的情况下它必须是'myeventplugin_pi1'。
下一行:
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'layout,select_key,pages,recursive';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:'.$extKey . '/Configuration/FlexForms/contentPlugin.xml');
这对我来说很实用,在你看来还不错。如果更改flexforms的值,最好的方法是重新安装扩展,因为这通常是深度缓存的。