Numbered SectionIndex based on header layout

Submitting your vote...
Rating: 5.0 of 5. 2 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



Comments


No comments

Add comment

* - required field

*



*
*

Top 10 Updates

Nice fonts using Google font API geändert am  20-May-2010 16:36:47
TS-based Searchbox for Indexed Search  geändert am  18-May-2010 18:27:15
TYPO3 SEO geändert am  30-Apr-2010 09:44:22
Search engine friendly graphical headers in TYPO3 geändert am  30-Apr-2010 09:33:44
Creating a simple Infocenter using TYPO3 geändert am  17-Nov-2009 12:12:52
Making the Section Menu work correctly with TemplaVoila geändert am  05-May-2009 12:27:17
Show pages with type "Not in Menu" in a sitemap geändert am  05-May-2009 12:11:17
Implementation of the DHTML menu from brainjar.com  geändert am  01-Feb-2009 14:02:48
Sample DHTML menu geändert am  01-Feb-2009 13:51:25
A introduction to the CONTENT object geändert am  26-Jan-2009 13:20:39

Latest comments

21-Jan-2012 20:22:24
jemmkwc jemmkwc schrieb: MOGWOX , [url=http://prdpuhwzxyrc.com/]prdpuhwzxyrc[/url],...
fe_useradmin form does not save
20-Jan-2012 20:35:32
fsivjktiuld fsivjktiuld schrieb: idCmnv <a href="http://gakbrrkrxhye.com/">gakbrrkrxhye</a>
fe_useradmin form does not save
19-Jan-2012 18:05:25
bvffee bvffee schrieb: jl2vQt , [url=http://xcinvpbclrbm.com/]xcinvpbclrbm[/url],...
External links and shortcuts directly in the menu
Deutsch
Search: