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

jaco graaff jaco at spacexplorer.co.za
Wed Sep 21 05:46:56 CEST 2011


Man, I should have just created a custom php script - fed the whole menu 
into that and send it back

Is this the better option - I think it will take less time???

Typoscript makes it really difficult for certain things (I know it's not 
scripting but just declaration)

anyway - I am having difficulty getting the 3rd level rendered under their 
parents which is now divided in columns:

example:


level1  ##the start - I handle this with a TEXT object now since DIRECTORY 
listing does not start with the special.value=PID - but the next level

(level2:column01)   ## to get columns I have to use HMENU
--level2-item01 ## these gets seperated by TMENU - see TMENU.10, TMENU.20, 
TMENU.30
---------level3-item01 ## now usually this should work with TMENU on next 
level - but it does not work - if I use it it will disrupt the 
{register:count_HMENU_MENUOBJ}
---------level3-item02
--level2-item03
---------level3-item01
---------level3-item02

(level2:column02)
--level2-item02
--------level3-item01
--------level3-item02
--level2-item04
--------level3-item01
--------level3-item02




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

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


##---LEVEL 01
1 = TEXT
1.typolink.parameter = {$SERVICES_PID}



##---LEVEL 02
    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