[TYPO3] Advanced userFunc Condition

Nick Weisser typo3 at openstream.ch
Tue Jul 31 16:04:41 CEST 2007

Hi there,

I'm trying to use the following TypoScript condition in my TypoScript setup:

# submenu only shows if more than one subpage
# exists on the next level of the page tree
[userFunc = user_match(checkLevels)]
lib.submenu2 = HMENU

I've added the following user function to typo3conf/localconf.php as
suggested by TSref:

function user_match($cmd) {
	switch($cmd) {
	case 'checkLevels':
		if ("PID has more then one subpage") {
			return true;

I wonder if class.t3lib_treeview.php's getCount method can do the trick?


How would I add this method to the user function above? Is this at all
possible or does this require its own extension?

Or maybe there's another method that matches my requirement more exactly?

Any comments/pointers would be very much appreciated :-)

Cheers, Nick

More information about the TYPO3-english mailing list