Typolink inside section menu COA

你。 提交于 2019-12-10 12:18:23

问题


I have a custom section menu where I need a specific part of the menu item to be linked instead of the whole thing.

At the moment the typolink part doesn't do anything:

tt_content.menu.20.101 < tt_content.menu.20.3
tt_content.menu.20.101 {
  1.NO {
    doNotLinkIt = 1
    stdWrap.htmlSpecialChars = 0
    stdWrap.cObject = CONTENT
    stdWrap.cObject {
      table = tt_content
      select {
        pidInList.field = uid
      }
      renderObj = COA
      renderObj {    
        10 = TEXT
        10.field = header
        10.typolink {
          section.cObject = TEXT
          section.cObject.field = uid
          section.cObject.wrap = c|
        }
        20 = TEXT
        20.field = rowDescription
        20.wrap = <h6>|</h6>
      }
    }
  }
}

So the output I want from the example above would be something like:

<ul>
  <li><a href="/elementpage/#c1234">Element Header</a>Element Description etc..</li>
</ul>

回答1:


in the documentation you will find two possibilies:

  1. insert the complete anchor (with hash) into parameter
  2. use .section in combination with a page id for parameter (assuming the anchor is on another page)

that gives two solutions:

typolink {
    paramter.cObject = TEXT
    paramter.cObject {
        field = uid
        wrap = #c|
    }
}

or

typolink {
    parameter.field = pid
    section.cObject = TEXT
    section.cObject.field = uid
    section.cObject.wrap = c|
}    


来源:https://stackoverflow.com/questions/46233417/typolink-inside-section-menu-coa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!