第二个ifEmpty条件

Second ifEmpty condition

我尝试为当前页面创建第二个回退选项。 如果我的列为空,我当前的函数将获取父页面的内容。但如果我的后备方案也为空,我也需要一个选项。 它应该进入下一个级别(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
    }
  }
}

为什么搞的这么复杂?

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

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

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