Numbered SectionIndex based on header layout

Submitting your vote...
Rating: 5.0 of 5. 1 vote(s).
Click the rating bar to rate this item.

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}&nbsp|</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}&nbsp|</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}&nbsp|</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}&nbsp|</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}&nbsp|</p>
  }
}

 

This snippet was submitted by Peter Klein

 

This snippet is very similar to the following

Numbered headers based on layout


Top 10 Updates

Using Transparent PNG's in IE5/6 without JavaScript geändert am  04-Oct-2008 12:27:15
Using lightbox without extension geändert am  13-Jun-2008 14:20:51
Custom field for GMENU alt text geändert am  13-Jun-2008 13:58:07
Extending typoscript properties with stdWrap geändert am  13-Jun-2008 13:54:32
Create menus using data from other tables than "pages" V2  geändert am  24-Mar-2008 13:02:09
Login geändert am  17-Mar-2008 12:47:52
Forum geändert am  17-Mar-2008 10:07:47
Who is Typo3wizard.com geändert am  26-Dec-2007 16:07:32
Menu as un-nested lists (iphone navigation) geändert am  29-Oct-2007 15:05:53
IF Conditions with AND and OR operators geändert am  16-Oct-2007 19:16:04
Deutsch
Search: