| Author |
Message |
risotto
Joined: 17 Oct 2006 Posts: 2
|
Posted: 17 Oct 2006 - 12:56 pm Post subject:
Hide empty menus in JSMenu
|
|
|
Hi everyone,
I'm working with a JSMENU and actually everything went fine as I was expecting it. Just one issue: does anyone know how to hide empty drop-down lists when working with multiple levels? I would like to hide unused levels whenever there are no links available.
And does anyone know if there are issues with realurl when using JSMENU?
Cheers,
Risotto |
|
|
Back to top
|
|
|
risotto
Joined: 17 Oct 2006 Posts: 2
|
Posted: 18 Oct 2006 - 1:02 pm Post subject:
Solution
|
|
|
Since nobody bothered to answer and since I just found out a solution by myself, here's the code. BTW, this works cleanly with realURL:
| Line: |
Code: |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| |
lib.mainMenu = COA
lib.mainMenu {
10 = HMENU
10.entryLevel = 0
10.1 = TMENU
10.1 {
wrap = <select onchange="if (this[this.selectedIndex].value!=0) document.location.href=this[this.selectedIndex].value"><option value="0"></option>|</select>
NO {
doNotLinkIt = 1
stdWrap.cObject = COA
stdWrap.cObject {
10 = COA
10 {
wrap = <option value="|">
10 = TEXT
10.data = getIndpEnv:TYPO3_REQUEST_HOST
10.wrap = |/
20 = TEXT
20.typolink.parameter.field = uid
20.typolink.returnLast = url
}
20 = TEXT
20.field = title
20.wrap = |</option>
}
}
ACT < .NO
ACT = 1
ACT.stdWrap.cObject.10.wrap =<option value="|" selected=selected>
}
20 = HMENU
20 < .10
20.entryLevel = 1
30 = HMENU
30 < .10
30.entryLevel = 2
40 = HMENU
40 < .10
40.entryLevel = 3
50 = HMENU
50 < .10
50.entryLevel = 4
}
|
|
Show complete code
|
|
|
|
Back to top
|
|
|
|