WWW.GAMEREACTION.NL

"
Ooo. They've got the Internet on computers now.
" - Homer Simpson
You are here: gamereaction.nl  > Blog  > Typoscript conditions 

Typoscript conditions

posted on 4 March 2009 in TYPO3

Thought I would post here a basic guide to conditional statements as I and some others seem to forget them a lot and they are such a handy thing, below is probably only useful to save me finding them in the tsref.

The following is a conditional statement used to only effect pages with id 1 and 2:
[globalVar = TSFE:id = 1,2]
As you can see in this example we can link conditional values with a comma meaning we don't need to write out the

whole statement again.


Want to just effect a single browser? also simple with the following:
[browser = msie]

We can even base our condition on the version of some browsers:
[version => 6]

Another option is to punish users of windows by adding some ugly css template? :P
[system = win]

Or possibly you want to display only certain parts of your sites to robots and cant be bothered setting your

robots.txt? this can be accomplished with:
[device = robot]

After any conditional script you will need to close the conditional and return to normal using the global tag:
[global]

These are just the basics of a few of the possible conditions you can use in your scripts, if you want a more

detailed explanation or are looking for something I haven't covered check out the conditional reference in the

TSREF:

Further Reading : http://typo3.org/documentation/document-library/references/doc_core_tsref/4.2.0/view/1/4/

1 comment has been posted

Richard said this on 3 August 2009 @ 10:14

Well done with the formatting here richard, brilliant site!





are you human?

this site was made by gamereaction
powered by TYPO3
RSS Feed