<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on snippet: 'Conditions in Typoscript'</title>
<link>http://snipplr.com</link>
<description>Snipplr comments feed'</description>
<language>en-us</language>
<pubDate>Sun, 19 May 2013 20:25:35 GMT</pubDate>
<item>
<title>xtine777 said on 6/29/09</title>
<link>http://snipplr.com/view/16432/conditions-in-typoscript/</link>
<description><![CDATA[ Typoscript-Conditions

This will match with a url like "...&amp;print=1"
[globalVar = GP:print > 0]


This will match with an url like "...&amp;tx_ext_pi1[var1]=1"
[globalVar = GP:tx_ext_pi1|var1 > 0]

 
This will match with a remote-addr begining with "192.168."
[globalString = ENV:REMOTE_ADDR = 192.168.*]

 
This will match with the page-id being higher than 10:
[globalVar = TSFE:id > 10]

 
This will match with the pages having the layout field set to "Layout 1":
[globalVar = TSFE:page|layout = 1]


If the constant {$constant_to_turnSomethingOn} is "1" then this matches:
[globalVar = LIT:1 = {$constant_to_turnSomethingOn}]

 
This will match with netscape and opera-browsers
[browser = netscape, opera]


This will match if any BE-user is logged in:
[globalVar = TSFE : beUserLogin > 0]


This matches logins from users members of groups with uid's 1 and/or 2:
[usergroup = 1,2]


This will match on any FE-user (because every FE-user has an usergroup)
[usergroup = *]

better:
[loginUser = *]


This matches logins from special users uid's fe_users-uid1 and/or fe_users-uid2, ...:
[loginUser = fe_users-uid1, fe_users-uid2, ...]

 
This checks if one of the figures in "pages-uidl" is a PID (pages-uid) in the rootline:
[PIDinRootline = pages-uid, pages-uid, ...]

 
Do the same as PIDinRootline, except the current page-uid is excluded from check.
[PIDupinRootline = pages-uid, pages-uid, ...]


This ends any conditions:
[end]

or this:
[global]


Es ist nicht möglich Conditions von Werten, die in vorgehenden Conditions gesetzt werden abhängig zu machen:

folgendes funktioniert nicht !

# default-Konfiguration
config.sys_language_uid = 0
config.language = en
config.locale_all = en_EN
config.htmlTag_langKey = en
 

[globalVar = GP:L = 1]
# Konfiguration wenn &amp;L=1 angegeben
config.sys_language_uid = 1
config.language = de

config.locale_all = de_DE

config.htmlTag_langKey = de

[global]

  :

  :

# Versuch obiges Setzen von sys_language_uid abzufragen:

[globalVar = TSFE:sys_language_uid = 1]

hier kommt man niemals hin, auch wenn die Abfrage grundsätzlich möglich ist und abgefragt werden kann.

[global]

 

Anmerkung:

in Extensions ist das Abfragen der GET-Variablen t3lib_div::GPVar('L') zum Bestimmen der Sprache eher verkehrt.

Dort sollte man immer auf $GLOBALS['TSFE']->sys_language_uid zurückgreifen um zu bestimmen welcher übersetzte Datensatz gerade benutzt werden soll.


http://www.pi-phi.de/19.html ]]></description>
<pubDate>Mon, 29 Jun 2009 06:07:55 GMT</pubDate>
<guid>http://snipplr.com/view/16432/conditions-in-typoscript/</guid>
</item>
</channel>
</rss>