Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typo3 如何向Flexform插件配置添加工具提示?_Typo3_Extbase_Typo3 6.2.x - Fatal编程技术网

Typo3 如何向Flexform插件配置添加工具提示?

Typo3 如何向Flexform插件配置添加工具提示?,typo3,extbase,typo3-6.2.x,Typo3,Extbase,Typo3 6.2.x,我想这很简单,只要你知道一次,但我现在搜索这个主题4个多小时。也许有人能帮我,把我推到正确的方向 我用Extbase为typo36.2开发了一个扩展。 插件配置是通过FlexForm完成的。 为了增加实用性,我想在FlexForm中添加工具提示(HelpText或CSH) 方法1: 我用标签试过了 <cshFile> locallang\u csh\u flexforms.xml <?xml version="1.0" encoding="utf-8" standalone=

我想这很简单,只要你知道一次,但我现在搜索这个主题4个多小时。也许有人能帮我,把我推到正确的方向

我用Extbase为typo36.2开发了一个扩展。 插件配置是通过FlexForm完成的。 为了增加实用性,我想在FlexForm中添加工具提示(HelpText或CSH)

方法1: 我用标签试过了

<cshFile>
locallang\u csh\u flexforms.xml

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
    <description>CSH for flexforms</description>
    <type>CSH</type>
    <fileId>EXT:psc_disqus_sso/locallang_csh_flexforms.xml</fileId>
    <labelContext type="array"></labelContext>
</meta>
<data type="array">
    <languageKey index="default" type="array">
        <label index="settings.useSSO.description">Check to Use SSO Functionality</label>

        <label index="settings.disqus.general.shortName.description">Tells the Disqus service your forum's shortname, which is the unique identifier for your website as registered on Disqus. If undefined, the Disqus embed will not load.</label>
        <label index="settings.disqus.general.title.description">Tells the Disqus service the title of the current page. This is used when creating the thread on Disqus for the first time. If undefined, Disqus will use the <title> attribute of the page. If that attribute could not be used, Disqus will use the URL of the page.</label>
        <label index="settings.disqus.general.categoryId.description">Tells the Disqus service the category to be used for the current page. This is used when creating the thread on Disqus for the first time.</label>
        <label index="settings.disqus.general.disableMobile.description">Tells the Disqus service to never use the mobile optimized version of Disqus.</label>

...(just some more labels and closing tags)...
<T3DataStructure>
<meta>
    <langDisable>1</langDisable>
</meta>
 <sheets>
  <sDEF>
   <ROOT>
     <TCEforms>
        <sheetTitle>SSO Settings</sheetTitle>
     </TCEforms>
     <type>array</type>
     <el>
        <settings.useSSO>
            <TCEforms>
                <label>Activate Disqus Single Sign On</label>
                <config>
                    <type>check</type>
                </config>
                <onChange>reload</onChange>
            </TCEforms>      
        </settings.useSSO>
         <settings.disqus.sso.name>
            <TCEforms>
                <label>Website name (Your site's name. Disqus will display it in the Post As window.)</label>
                <config>
                    <type>input</type>
                    <size>30</size>
                    <default>Website</default>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.name>
        <settings.disqus.sso.loginButton>
            <TCEforms>
                <label>Login Button (optional)</label>
                <config>
                    <type>group</type>
                    <internal_type>file</internal_type>
                    <allowed>jpg,gif,png</allowed>
                    <max_size>2000</max_size>
                    <uploadfolder>uploads/tx_pscdisqussso/loginButton</uploadfolder>
                    <show_thumbs>1</show_thumbs>
                    <size>1</size>
                    <minitems>0</minitems>
                    <maxitems>1</maxitems>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.loginButton>
        <settings.disqus.sso.favIcon>
            <TCEforms>
                <label>Icon (optional)</label>
                <config>
                    <type>group</type>
                    <internal_type>file</internal_type>
                    <allowed>jpg,gif,png</allowed>
                    <max_size>2000</max_size>
                    <uploadfolder>uploads/tx_pscdisqussso/loginButton</uploadfolder>
                    <show_thumbs>1</show_thumbs>
                    <size>1</size>
                    <minitems>0</minitems>
                    <maxitems>1</maxitems>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.favIcon>
        <settings.disqus.sso.loginPage>
            <TCEforms>
                <label>Login Page</label>
                <config>
                    <type>group</type>
                    <internal_type>db</internal_type>
                    <allowed>pages</allowed>
                    <size>1</size>
                    <maxitems>1</maxitems>
                    <minitems>0</minitems>
                    <show_thumbs>1</show_thumbs>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.loginPage>
        <settings.disqus.sso.loginHeight>
            <TCEforms>
                <label>Login Window Height</label>
                <config>
                    <type>input</type>
                    <size>20</size>
                    <max>30</max>
                    <default>800</default>
                    <eval>int</eval>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.loginHeight>
        <settings.disqus.sso.loginWidth>
            <TCEforms>
                <label>Login Window Width</label>
                <config>
                    <type>input</type>
                    <size>20</size>
                    <max>30</max>
                    <default>400</default>
                    <eval>int</eval>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.loginWidth>
     </el>
   </ROOT>
  </sDEF>
  <disqusConfigurationGeneral>
   <ROOT>
     <TCEforms>
      <sheetTitle>Disqus Settings</sheetTitle>
     </TCEforms>
     <type>array</type>
     <el>
        <settings.disqus.general.shortName>
            <TCEforms>
                <label>Disqus Shortname</label>
                <config>
                    <type>input</type>
                    <size>30</size>
                    <eval>required</eval>
                </config>
            </TCEforms>      
        </settings.disqus.general.shortName>
        <settings.disqus.general.title>
            <TCEforms>
                <label>Title (Tells the Disqus service the title of the current page. This is used when creating the thread on Disqus for the first time. If undefined, Disqus will use the &lt;title&gt; attribute of the page. If that attribute could not be used, Disqus will use the URL of the page.)</label>
                <config>
                    <type>input</type>
                    <size>30</size>
                </config>
            </TCEforms>      
        </settings.disqus.general.title>
        <settings.disqus.general.categoryId>
            <TCEforms>
                <label>Disqus Category (see documentation)</label>
                <config>
                    <type>input</type>
                    <size>30</size>
                </config>
            </TCEforms>      
        </settings.disqus.general.categoryId>
        <settings.disqus.general.disableMobile>
            <TCEforms>
                <label>Disable Disqus Mobile Optimization (see documentation)</label>
                <config>
                    <type>check</type>
                </config>
            </TCEforms>      
        </settings.disqus.general.disableMobile>
        <settings.disqus.general.disableMobile>
            <TCEforms>
                <label>Disable Disqus Mobile Optimization (see documentation)</label>
                <config>
                    <type>check</type>
                </config>
            </TCEforms>
        </settings.disqus.general.disableMobile>
     </el>
   </ROOT>
  </disqusConfigurationGeneral>
 </sheets>
</T3DataStructure>

柔性模板的CSH
CSH
EXT:psc_discus_sso/locallang_csh_flexforms.xml
检查以使用SSO功能
告诉Disqs服务您的论坛的短名称,这是您在Disqs上注册的网站的唯一标识符。如果未定义,则不会加载DISKS嵌入。
告诉Disqs服务当前页面的标题。这是第一次在disks上创建线程时使用的。如果未定义,Disqus将使用页面的属性。如果无法使用该属性,Disqs将使用该页面的URL。
告诉Disqs服务当前页面要使用的类别。这是第一次在disks上创建线程时使用的。
告诉Discus服务永远不要使用Discus的移动优化版本。
…(只是更多的标签和结束标记)。。。
SsoSession.xml

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
    <description>CSH for flexforms</description>
    <type>CSH</type>
    <fileId>EXT:psc_disqus_sso/locallang_csh_flexforms.xml</fileId>
    <labelContext type="array"></labelContext>
</meta>
<data type="array">
    <languageKey index="default" type="array">
        <label index="settings.useSSO.description">Check to Use SSO Functionality</label>

        <label index="settings.disqus.general.shortName.description">Tells the Disqus service your forum's shortname, which is the unique identifier for your website as registered on Disqus. If undefined, the Disqus embed will not load.</label>
        <label index="settings.disqus.general.title.description">Tells the Disqus service the title of the current page. This is used when creating the thread on Disqus for the first time. If undefined, Disqus will use the <title> attribute of the page. If that attribute could not be used, Disqus will use the URL of the page.</label>
        <label index="settings.disqus.general.categoryId.description">Tells the Disqus service the category to be used for the current page. This is used when creating the thread on Disqus for the first time.</label>
        <label index="settings.disqus.general.disableMobile.description">Tells the Disqus service to never use the mobile optimized version of Disqus.</label>

...(just some more labels and closing tags)...
<T3DataStructure>
<meta>
    <langDisable>1</langDisable>
</meta>
 <sheets>
  <sDEF>
   <ROOT>
     <TCEforms>
        <sheetTitle>SSO Settings</sheetTitle>
     </TCEforms>
     <type>array</type>
     <el>
        <settings.useSSO>
            <TCEforms>
                <label>Activate Disqus Single Sign On</label>
                <config>
                    <type>check</type>
                </config>
                <onChange>reload</onChange>
            </TCEforms>      
        </settings.useSSO>
         <settings.disqus.sso.name>
            <TCEforms>
                <label>Website name (Your site's name. Disqus will display it in the Post As window.)</label>
                <config>
                    <type>input</type>
                    <size>30</size>
                    <default>Website</default>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.name>
        <settings.disqus.sso.loginButton>
            <TCEforms>
                <label>Login Button (optional)</label>
                <config>
                    <type>group</type>
                    <internal_type>file</internal_type>
                    <allowed>jpg,gif,png</allowed>
                    <max_size>2000</max_size>
                    <uploadfolder>uploads/tx_pscdisqussso/loginButton</uploadfolder>
                    <show_thumbs>1</show_thumbs>
                    <size>1</size>
                    <minitems>0</minitems>
                    <maxitems>1</maxitems>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.loginButton>
        <settings.disqus.sso.favIcon>
            <TCEforms>
                <label>Icon (optional)</label>
                <config>
                    <type>group</type>
                    <internal_type>file</internal_type>
                    <allowed>jpg,gif,png</allowed>
                    <max_size>2000</max_size>
                    <uploadfolder>uploads/tx_pscdisqussso/loginButton</uploadfolder>
                    <show_thumbs>1</show_thumbs>
                    <size>1</size>
                    <minitems>0</minitems>
                    <maxitems>1</maxitems>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.favIcon>
        <settings.disqus.sso.loginPage>
            <TCEforms>
                <label>Login Page</label>
                <config>
                    <type>group</type>
                    <internal_type>db</internal_type>
                    <allowed>pages</allowed>
                    <size>1</size>
                    <maxitems>1</maxitems>
                    <minitems>0</minitems>
                    <show_thumbs>1</show_thumbs>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.loginPage>
        <settings.disqus.sso.loginHeight>
            <TCEforms>
                <label>Login Window Height</label>
                <config>
                    <type>input</type>
                    <size>20</size>
                    <max>30</max>
                    <default>800</default>
                    <eval>int</eval>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.loginHeight>
        <settings.disqus.sso.loginWidth>
            <TCEforms>
                <label>Login Window Width</label>
                <config>
                    <type>input</type>
                    <size>20</size>
                    <max>30</max>
                    <default>400</default>
                    <eval>int</eval>
                </config>
                <displayCond>FIELD:settings.useSSO:REQ:true</displayCond>
            </TCEforms>      
        </settings.disqus.sso.loginWidth>
     </el>
   </ROOT>
  </sDEF>
  <disqusConfigurationGeneral>
   <ROOT>
     <TCEforms>
      <sheetTitle>Disqus Settings</sheetTitle>
     </TCEforms>
     <type>array</type>
     <el>
        <settings.disqus.general.shortName>
            <TCEforms>
                <label>Disqus Shortname</label>
                <config>
                    <type>input</type>
                    <size>30</size>
                    <eval>required</eval>
                </config>
            </TCEforms>      
        </settings.disqus.general.shortName>
        <settings.disqus.general.title>
            <TCEforms>
                <label>Title (Tells the Disqus service the title of the current page. This is used when creating the thread on Disqus for the first time. If undefined, Disqus will use the &lt;title&gt; attribute of the page. If that attribute could not be used, Disqus will use the URL of the page.)</label>
                <config>
                    <type>input</type>
                    <size>30</size>
                </config>
            </TCEforms>      
        </settings.disqus.general.title>
        <settings.disqus.general.categoryId>
            <TCEforms>
                <label>Disqus Category (see documentation)</label>
                <config>
                    <type>input</type>
                    <size>30</size>
                </config>
            </TCEforms>      
        </settings.disqus.general.categoryId>
        <settings.disqus.general.disableMobile>
            <TCEforms>
                <label>Disable Disqus Mobile Optimization (see documentation)</label>
                <config>
                    <type>check</type>
                </config>
            </TCEforms>      
        </settings.disqus.general.disableMobile>
        <settings.disqus.general.disableMobile>
            <TCEforms>
                <label>Disable Disqus Mobile Optimization (see documentation)</label>
                <config>
                    <type>check</type>
                </config>
            </TCEforms>
        </settings.disqus.general.disableMobile>
     </el>
   </ROOT>
  </disqusConfigurationGeneral>
 </sheets>
</T3DataStructure>

1.
单点登录设置
排列
激活单点登录
检查
重新加载
网站名称(您的网站名称。Discus将在Post As窗口中显示。)
输入
30
网站
字段:设置。使用SSO:REQ:true
登录按钮(可选)
组
文件
jpg,gif,png
2000
上传/tx_pscdisqusso/loginButton
1.
1.
0
1.
字段:设置。使用SSO:REQ:true
图标(可选)
组
文件
jpg,gif,png
2000
上传/tx_pscdisqusso/loginButton
1.
1.
0
1.
字段:设置。使用SSO:REQ:true
登录页面
组
分贝
页
1.
1.
0
1.
字段:设置。使用SSO:REQ:true
登录窗口高度
输入
20
30
800
int
字段:设置。使用SSO:REQ:true
登录窗口宽度
输入
20
30
400
int
字段:设置。使用SSO:REQ:true
Discus设置
排列
短名
输入
30
必修的
Title(告诉Disqs服务当前页面的标题。这在首次在Disqs上创建线程时使用。如果未定义,Disqs将使用页面的Title属性。如果无法使用该属性,Disqs将使用页面的URL。)
输入
30
论文类别(见文件)
输入
30
禁用Disqs移动优化(请参阅文档)
检查
禁用Disqs移动优化(请参阅文档)
检查

这很容易。。。但在这种情况下,typo36.2的缓存可能会非常恼人

  • 假设您有一个带有键
    my_extension
    Bar
    插件的扩展,ext_tables.php中包含的常见flexform如下所示:

    $pluginSignature = str_replace('_','',$_EXTKEY) . '_bar'; // which gives `myextension_bar`
    $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_bar.xml');
    
  • 为CSH创建一个示例文件(根据惯例,名称无关紧要…):

  • 使用property(!)键在ext_tables.php中添加对此locallang的引用

    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
        'tt_content.pi_flexform.myextension_bar.list',
        'EXT:my_extension/Resources/Private/Language/locallang_csh_flexform_bar.xlf'
    );
    
  • 最重要的打开安装工具,转到重要操作并单击清除所有缓存

  • 仅此而已:如果CSH没有检查locallang(
    tt\u content.pi\u flexform…
    )的键是否有效,那么现在应该可以工作了,如果它在那里列出(如果没有再次清除缓存表单安装工具),还可以检查配置$GLOBALS['TCA\u DESCR']

  • 示例locallang\u csh\u flexform\u bar.xlf

    <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
    <xliff version="1.0">
        <file source-language="en" datatype="plaintext" original="messages" date="2014-05-28T07:44:03Z" product-name="my_extension">
            <header/>
            <body>
                <trans-unit id="settings.disqus.sso.name.description">
                    <source>Your site's name. Disqus will display it in the Post As window.</source>
                </trans-unit>
            </body>
        </file>
    </xliff>