菜单中的Typolink内容?

时间:2016-08-24 00:33:07

标签: typo3 typoscript

我正在尝试创建一个菜单,显示页面的第一个内容元素标题和图像,并将它们作为链接。但是typolink部分似乎并不适合我:

lib.menu = HMENU
lib.menu {
  1 = TMENU
  1.NO {
    doNotLinkIt = 1
    wrapItemAndSub = <div>|</div>
    stdWrap.cObject = CONTENT
    stdWrap.cObject {
      table = tt_content
      select {
        pidInList.field = uid
      }
      renderObj = COA
      renderObj {

        10 = TEXT
        10.field = header
        10.typolink.parameter.field = uid
      }
    }
  }
}

1 个答案:

答案 0 :(得分:0)

只需添加完整的工作示例。使用section.field = uid,您可以链接到内容元素本身。

lib.menu = HMENU
lib.menu {
    1 = TMENU
    1.NO {
        doNotLinkIt = 1
        wrapItemAndSub = <div>|</div>
        stdWrap.cObject = CONTENT
        stdWrap.cObject {
            table = tt_content
            select {
                pidInList.field = uid
            }
            renderObj = COA
            renderObj {

                10 = TEXT
                10.field = header
                10.typolink {
                    parameter.field = pid
                    section.field = uid
                }
            }
        }
    }
}