0

我正在使用 Typoscript 中的 HMENU 创建一个菜单。现在我的问题是:是否有可能检查链接的分页是否为任何内容。如果没有,我该如何禁用链接?

我使用以下代码生成菜单

  NAV = HMENU
  NAV{
  entryLevel = 0
  wrap = <ul class="nav">|</ul>
  1 = TMENU
  1.NO {
    allWrap = <li class="nav-button"><p class="title">|</p></li>
  }
  1.ACT = 1
  1.ACT {
    allWrap = <li class="nav-button selected"><p class="title">|</p></li>
  }
}
4

1 回答 1

0

未经测试!

如果该页面上有任何 tt_content 记录,您可以使用 numRows 检查(如果您只想检查特定记录,可以使用WHERE )使用required您定义,仅当 numRows 大于 1 时才会呈现此菜单项。

NAV.1.NO.allStdWrap.required.numRows {
  table = tt_content
  select {
    # uid of this page, is the pid of the records to look for
    pidInList.field = uid
  }
}
NAV.1.ACT.allStdWrap < NAV.1.NO.allStdWrap
于 2013-04-17T09:08:23.073 回答