为什么{settings.split}返回“”而不是<f:debug>显示的预期数组值?

问题描述

我正在使用flux创建一个两列内容元素(基于之前的fluid-bootstrap-theme的内容,因为我当时使用它)。 在内容模板中使用变量settings.split时,它在a转储中显示<f.debug>。但是,在浏览器中呈现时,使用{settings.split}不会返回任何内容
我不明白为什么它不返回a

名为adsettings.split的变量按预期返回a

能给我一些建议吗?
非常感谢!

Templates / Content / TwoColumn.html中的

代码示例:

    <f:layout name="Default" />
    
    <f:section name="Configuration">
        <f:debug>{_all}</f:debug>
        <flux:form id="andre">
            <flux:form.sheet name="colSettings">
                <flux:field.select name="adsettings.split"
                                   items="a,b,c,d"
                                   default="a"
                                   requestUpdate="1">
                </flux:field.select>
                <flux:field.select name="settings.split"
                                   items="a,d"
                                   default="a"
                                   requestUpdate="1">
                </flux:field.select>
            </flux:form.sheet>
        </flux:form>
    </f:section>
    
    <f:section name="Preview">
    {settings.split}
        {split}
    </f:section>
    
    <f:section name="Main">
        ADSettings: {adsettings.split}
        Settings: {settings.split}
    </f:section>

截屏:

Screenshot of Output

版本:

  • Typo3 10.4.9
  • 助焊剂9.4.2
  • Vhs 6.0.4

解决方法

也许您在“后端”中进行了保存和编辑之后才重命名了该字段?该代码是正确的,我在FCE中对其进行了测试。

解决方案: 删除元素并创建一个新的元素,然后它将起作用。

,

每个部分都有自己的上下文和定义的变量。通常,只有您使用arguments参数提供的内容。

如果将<f:debug>{_all}</f:debug>放在部分中,则会看到不同的(无)变量。


如果要在部分中添加变量,则需要参数。

您只能传输单个参数,例如:
<f:render section="Main" arguments="{par1:'string,par2:fluidVar}" />

或通过以下方式传输所有可用的流体变量:
<f:render section="Main" arguments="{_all}" />