[TYPO3-english] conditional menu based on menu page-id

Bernhard Kraft kraftb at kraftb.at
Mon Nov 30 16:07:34 CET 2009


David Banning schrieb:

> 
> [globalVar = TSFE:id=799]
>    libmenu.1.IFSUB.doNotLinkIt = 1
> [END]
> 

This does not work, cause conditions get evaluated when the TypoScript gets
parsed. Not when it gets executed.

You could compare this to "#define" statements in a C-Program. They will
get replaced when the programm is compiled, not upon execution.


To solve your problems you could use a "CASE" typoScript object, doing
different things depending on some variables. Since 4.3 the "doNotLinkIt"
property does have "stdWrap" properties, altough this is currently not
documented in TSref, because the documentation needs to get updated for 4.3

But if you already use the new 4.3 version of TYPO3 or can update to it you
can do something like:

---------------------------------------------
lib.1.IFSUB.doNotLinkIt.cObject = CASE
lib.1.IFSUB.doNotLinkIt.cObject {
	key.data = TSFE:id

	default = TEXT
	default.value = 0

	799 = TEXT
	799.value = 0
}
---------------------------------------------

This is something like a PHP/C "switch" statement. The property "key"
defines the value to examine and the single cObjects like "799" define the
value to return in case the key contains it's value.

The value of the cObject "default" will get returned if no other values
match. I guess it would also be ok to leave it just away in the above example.


greets,
Bernhard



More information about the TYPO3-english mailing list