部分菜单 COA 内的 Typolink [英] Typolink inside section menu COA

查看:20
本文介绍了部分菜单 COA 内的 Typolink的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义部分菜单,我需要在其中链接菜单项的特定部分,而不是整个菜单项.

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>

推荐答案

文档 你会发现两种可能性:

in the documentation you will find two possibilies:

  1. 将完整的锚点(带哈希)插入参数
  2. 使用 .section 结合页面 ID 作为参数(假设锚点在另一个页面上)
  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)

给出了两种解决方案:

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

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

这篇关于部分菜单 COA 内的 Typolink的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆