user500665
user500665

Reputation: 1362

Typolink inside section menu COA

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>

Upvotes: 0

Views: 398

Answers (1)

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10791

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|
}    

Upvotes: 1

Related Questions