


Changes the standard SectionIndex menu type, so menu items will be prefixed with a number, based on the headertype used on the contentelements.
If first header is of type 1 (or default), then 1 digit number will be prefixed.
If the header following a header type 1, then 2 digit number will be prefixed and so on.
So a page with header types like this:
type1
type2
type2
type3
type2
type1
type1
would generate a menu like this:
1 header
1.1 header
1.2 header
1.2.1 header
1.3 header
2 header
3 header
tt_content.menu.20.3 > tt_content.menu.20 { 3 < styles.content.get 3.wrap = <div class="csc-menu csc-menu-3">|</div> 3.select.andWhere = sectionIndex!=0 3.select.pidInList.override.field = pages 3.renderObj = CASE 3.renderObj { key.field = header_layout default = COA default { stdWrap.fieldRequired = header 10 = LOAD_REGISTER 10.L1Counter.cObject = TEXT 10.L1Counter.cObject.data = register:L1Counter 10.L1Counter.cObject.wrap = |+1 10.L1Counter.prioriCalc = intval 10.L2Counter = 0 10.L3Counter = 0 10.L4Counter = 0 10.L5Counter = 0 20 = TEXT 20.field = header 20.trim = 1 20.htmlSpecialChars = 1 20.dataWrap = <p class="csc-section">{register:L1Counter} |</p> 20.typolink.parameter.field = pid 20.typolink.section.field = uid } 1 < .default 2 < .default 2.10.L2Counter > 2.10.L2Counter.cObject < .2.10.L1Counter.cObject 2.10.L2Counter.cObject.data = register:L2Counter 2.10.L2Counter.prioriCalc = intval 2.10.L1Counter > 2.20.dataWrap = <p class="csc-section">{register:L1Counter}.{register:L2Counter} |</p> 3 < .2 3.10.L3Counter > 3.10.L3Counter.cObject < .3.10.L2Counter.cObject 3.10.L3Counter.cObject.data = register:L3Counter 3.10.L3Counter.prioriCalc = intval 3.10.L2Counter > 3.20.dataWrap = <p class="csc-section">{register:L1Counter}.{register:L2Counter}.{register:L3Counter} |</p> 4 < .3 4.10.L4Counter > 4.10.L4Counter.cObject < .4.10.L3Counter.cObject 4.10.L4Counter.cObject.data = register:L4Counter 4.10.L4Counter.prioriCalc = intval 4.10.L3Counter > 4.20.dataWrap = <p class="csc-section">{register:L1Counter}.{register:L2Counter}.{register:L3Counter}.{register:L4Counter} |</p> 5 < .4 5.10.L5Counter > 5.10.L5Counter.cObject < .5.10.L4Counter.cObject 5.10.L5Counter.cObject.data = register:L5Counter 5.10.L5Counter.prioriCalc = intval 5.10.L4Counter > 5.20.dataWrap = <p class="csc-section">{register:L1Counter}.{register:L2Counter}.{register:L3Counter}.{register:L4Counter}.{register:L5Counter} |</p> } }
This snippet was submitted by Peter Klein
This snippet is very similar to the following
Numbered headers based on layout


Comments (0)