TYPO3 TCA语法到FlexForm语法

时间:2018-01-17 09:24:43

标签: php typo3

我有以下xml :(不是我的完整XML。在选择之后,我已经定义了一些设置,比如OrderBy,pid等)

<el>
<switchableControllerActions>
<TCEforms>
    <label>Select function</label>
    <onChange>reload</onChange>
    <config>
        <type>select</type>
        <items>
            <numIndex index="0">
                <numIndex index="0">List View</numIndex>
                <numIndex index="1">MyExt->list;MyExt->show</numIndex>
            </numIndex>
            <numIndex index="1">
                <numIndex index="0">Detail View</numIndex>
                <numIndex index="1">MyExt->show</numIndex>
            </numIndex>
            <numIndex index="5">
                <numIndex index="0">Import</numIndex>
                <numIndex index="1">--div--</numIndex>
            </numIndex>
            <numIndex index="10">
                <numIndex index="0">User Import</numIndex>
                <numIndex index="1">MyExt->import</numIndex>
            </numIndex>
        </items>
        <types>
            <numIndex index="0">
                <showItem index="0">orderBy</showItem>
                <showItem index="1">orderBy</showItem>
            </numIndex>
        </types>
    </config>
</TCEforms>
<switchableControllerActions>
</el>

我想要做的是为每个视图指定一些设置,而这些设置不适用于每个视图。例如,在列表视图中,我希望设置“单个视图的页面”,而不是详细信息或导入视图。我找到了这个文档:Documentation但我很难将其转换为FlexForm语法。

感谢任何帮助。

修改

在@Bernd Wilke之后,我向我展示了正确的方向,我找到了解决问题的方法。就是这样:

<pidSingle>
  <TCEforms>
    <label>Page for the single views</label>
    <displayCond>FIELD:switchableControllerActions:=:MyExt->list;ImmobilieImport->show</displayCond>
    <config>
     <type>input</type>
     <eval>trim</eval>
    </config>
  </TCEforms>
</pidSingle>

1 个答案:

答案 0 :(得分:1)

您需要针对特定​​设置的diplayconditions。

<pidSingle>
    <TCEforms>
        <label>Page for the single views</label>
        <displayCond>FIELD:el:=:1</displayCond>
        <config>
            <type>input</type>
            <eval>trim</eval>
        </config>
    </TCEforms>
</pidSingle>

请参阅manual

相关问题