通过研究示例,我尝试为扩展插件创建一个可切换的控制操作,但未显示。有人可以帮我找出原因吗?
在我的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';
...但仍然没有运气
答案 0 :(得分:1)
我看一下我的上一个扩展名:在我写的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的值,则重新安装扩展程序,因为它通常被深度缓存。