从研究示例中,我尝试为我的扩展插件创建一个可切换的控制操作,但它没有显示出来。谁能帮我弄清楚为什么?
在我的 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';
...但仍然没有运气