TYPO3-将flexform添加到我自己的扩展中 [英] TYPO3 - Add flexform to my own extension

查看:104
本文介绍了TYPO3-将flexform添加到我自己的扩展中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建自己的扩展程序. 我已经找到了有关将Flexform添加到扩展中的页面 https://gist.github.com/alrnz/c0f00b196d378f5b9150

I am building my own extension. I have found this page about adding Flexform to the Extension https://gist.github.com/alrnz/c0f00b196d378f5b9150

在我的ext_tables.php中,我有这个:

And in my ext_tables.php i have this:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    $_EXTKEY,
    'Xlsxtotables',
    'XLSX to tables'
);

// Include flex forms
$pluginSignature = str_replace('_', '', $_EXTKEY) . '_' .    'xlsxtotables'; // from registerPlugin(...)
$TCA['tt_content']['types']['list']['subtypes_addlist']   [$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
    $pluginSignature,    
    'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_xlsxtotables.xml'
); 

我知道XML文件在正确的位置,但是在TYPO3后端我从中什么也没得到.

I know that the XML-file is in the right place, but I do not get anyting from it in TYPO3 backend.

有什么建议吗?

推荐答案

您可以在 ext_tables.php 文件中尝试以下代码

You can try below code in ext_tables.php file

$pluginName = 'Pi1'; // Give Your Plugin Nmae
$pluginSignature = preg_replace('/[^a-z0-9]/', '', strtolower($_EXTKEY)) . '_' . strtolower($pluginName);

// FlexForm configuration
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
    $pluginSignature,
    'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexformname.xml'
);

要在一个或多个前端插件中添加Flexforms,可以在 ext_tables.php

For Adding Flexforms in One or More Front-end plugins you can use Below code in ext_tables.php

$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY);
$frontendpluginName = 'xxx'; //Your Front-end Plugin Name
$pluginSignature = strtolower($extensionName) . '_'.strtolower($frontendpluginName);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/xyz.xml');

这篇关于TYPO3-将flexform添加到我自己的扩展中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆