[TYPO3] If main menu doesn't have a submenu ... ?

Elijah Alcantara elijah.alcantara at gmail.com
Fri May 11 13:59:49 CEST 2007


How do I check if the current page doesn't have any submenu pages under it?

I have created two menus, one main menu on top and a side menu on the
left side of the content. Problem is when the user clicks on a menu on
top and it doesn't have any submenus on it the menu at the left side
will be empty. I would like it to default to get the items above it if
current level is empty ...


Here's what I have so far.. I know I'm probably doing this wrong...
I'm actually a bit confused right now on how to use negate and 'if'
... :

lib.submenu = COA
lib.submenu {
	wrap = <div class="submenucontainer">|</div>
        #should be standard menu for all pages
	20 = HMENU
	20.entryLevel = -1
	20.1 = TMENU
	20.1 {
		wrap = <div class="submenu"><ul>|</ul></div>
		NO.allWrap = <li>|</li>
		ACT < .NO
		ACT = 1
		ACT.allWrap = <li class="submenuact">|</li>
		}
	20.if.isTrue = 1

        #this should appear only when the current page is empty, then
replace the one above.
	30 = HMENU
	30.entryLevel = -2
	30.1 = TMENU
	30.1 {
		wrap = <div class="submenu"><ul>|</ul></div>
		NO.allWrap = <li>|</li>
		ACT < .NO
		ACT = 1
		ACT.allWrap = <li class="submenuact">|</li>
	}
	30.if.isTrue = 0
	30.if.negate = 1
}

submenu.20 and submenu.30 is both revealed and that is something I
don't want to happen :( I just wanted submenu.30 to appear(replace
submenu.20) only when the current page does not have any pages under
it..

Can anyone help ?



Elijah


More information about the TYPO3-english mailing list