首页 > 解决方案 > 在 TYPO3 模板中, v:variable.set 有效...但 f:variable 无效

问题描述

问题

我在一个文件中定制了一些东西,覆盖了这个news扩展文件Templates/Styles/Twb/Templates/News/List.html。这是工作...

<v:variable.set name="special.category" value="1" />

<f:if condition="{special.category}">
  <f:then>
    Do something for the special category when the variable's boolean value is 1
  </f:then>
  <f:else>
    Otherwise do something else
  </f:else>
</f:if>

但是当我尝试将其更改为此时,它不再起作用...

<f:variable name="special.category" value="1" />

<f:if condition="{special.category}">
  <f:then>
    Do something for the special category when the variable's boolean value is 1
  </f:then>
  <f:else>
    Otherwise do something else
  </f:else>
</f:if>

一些文档

我的平台

标签: typo3fluidview-helperstypo3-9.x

解决方案


我认为它是变量名中的点。在这种情况下,可能 vhs:variable 的实现方式不同。也许<f:variable name="special" value="{category: 1}"/>这行得通?


推荐阅读