【问题标题】:Second ifEmpty condition第二个 ifEmpty 条件
【发布时间】:2016-12-05 18:40:59
【问题描述】:

我尝试为当前页面创建第二个后备选项。 如果我的列为空,我当前的函数会获取父页面的内容。但如果我的后备也是空的,我也需要一个选项。 如果我的后备也应该为空,它应该会进入下一个级别 (leveluid:-3)。

有没有办法解决这个打字问题?

variables.element = CONTENT
variables.element {
  table = tt_content
  select {
    pidInList.data = page:uid
    orderBy = sorting
    where = colPos=3
  }
  # Fallback
  stdWrap.ifEmpty.cObject = CONTENT
  stdWrap.ifEmpty.cObject {
    table = tt_content
    select {
      pidInList.data = leveluid:-2
      orderBy = sorting
      where = colPos=3
    }
  }
  # Fallback 2
  stdWrap.ifEmpty.cObject = CONTENT
  stdWrap.ifEmpty.cObject {
    table = tt_content
    select {
      pidInList.data = leveluid:-3
      orderBy = sorting
      where = colPos=3
    }
  }
}

【问题讨论】:

    标签: if-statement typo3 typoscript typo3-6.2.x


    【解决方案1】:

    你为什么做的这么复杂?

    使用 CSC 或 FSC 定义 styles.content.get 以从主列 (colPos = 0) 收集内容记录。

    这很容易增强到其他列,并且有一种简单的机制可以从上面的页面收集内容:slide(参见 CONTENT 的文档)

    variables.element < styles.content.get
    variables.element.select.where = colPos = 3
    variables.element.slide = -1
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-26
      • 2020-08-17
      • 2014-04-26
      • 2018-04-18
      • 2018-08-13
      • 2013-12-12
      • 2012-07-13
      • 1970-01-01
      相关资源
      最近更新 更多