[TYPO3-english] typoscript multi-column mega-menu

jaco graaff jaco at spacexplorer.co.za
Wed Sep 21 03:58:10 CEST 2011


Is this the best way???

Because I am using DIRECTORY, the parent page OR starting PID is not 
included

I also need HMENU and not TMENU

If I use LIST instead of DIRECTORY the 2nd and 3rd level will be declared 
with a TMENU and not HMENU - which allows me to separate the columns out

so to include the parent I just reuse the variable of the entry-point

this is the additional code

##----------------------------------

## wrap all
wrap = <div class="level0" style="background: #00f; clear:both;">|</div>
##i need to include the parent page
##---LEVEL 01
1 = TEXT
1.typolink.parameter = {$SERVICES_PID}
-----------------------------------

and implemented with the rest.....


##--------------------------------------------------------------------------------------

lib.threeColumn >
lib.threeColumn = COA
lib.threeColumn {

wrap = <div class="level0" style="background: #00f; clear:both;">|</div>

##i need to include the parent page
##---LEVEL 01
1 = TEXT
1.typolink.parameter = {$SERVICES_PID}

##the 2nd and 3rd level as HMENU>TMENU
    10.wrap = col1<br>|
    10 = HMENU
    10.special = directory
    10.special.value = {$SERVICES_PID}
    10.1 = TMENU
    10.1.NO{
        allWrap=1: |<br>


        stdWrap.if.isFalse.prioriCalc=1
        stdWrap.if.isFalse.cObject=TEXT
        stdWrap.if.isFalse.cObject.insertData=1
        stdWrap.if.isFalse.cObject.value=({register:count_HMENU_MENUOBJ}+2)%3

        allWrap.if.isFalse.cObject=TEXT
        allWrap.if.isFalse.prioriCalc=1
        allWrap.if.isFalse.cObject.insertData=1
        allWrap.if.isFalse.cObject.value=({register:count_HMENU_MENUOBJ}+2)%3
    }


20 < .10
20.wrap = col2<br>|
    20.1.NO{
        allWrap=2: |<br>
        stdWrap.if.isFalse.cObject.value=({register:count_HMENU_MENUOBJ}+1)%3
        allWrap.if.isFalse.cObject.value=({register:count_HMENU_MENUOBJ}+1)%3
    }

30 < .10
30.wrap = col3<br>|
    30.1.NO{
        allWrap=3: |<br>
        stdWrap.if.isFalse.cObject.value=({register:count_HMENU_MENUOBJ})%3
        allWrap.if.isFalse.cObject.value=({register:count_HMENU_MENUOBJ})%3
    }
}

##--------------------------------------------------------------------------------------




so - if I wanted a 4th column
I would just add.............

##copy the code of .10 and just make necessary changes
40 < .10
## obviously the %3 would change to %4 in all code blocks
## I would then just test against +4 (1st column), +3 (2nd column), ......
+0(4th column)




More information about the TYPO3-english mailing list