Zum Inhalt springen

Cannot get TS condition working?

Erstellt am 11. April 2011 · 2 Antworten · letzte Antwort am 11. April 2011

Tags: Frage, English

denba ·

Hello,
I just build a new website based on the Introduction Package available on typo3.org.
I would like to implement some new stuff and I need to add some condition (am I on the homepage, language used, etc.). Unfortunately for ALL the condition I tried to insert, nothing is handled as expected (seems the [else] block is always used.

I think I'm doing something very basic but certainly also a systmatic error because when I just tried to add a condition in the page_configuration as follow, system does NOT take care of the condition:

# Make the PAGE object
page = PAGE
page {
# Regular pages always have typeNum = 0
typeNum = 0

1 = TEXT
1{
[system = win]
value = Win
[else]
value = Mac
[end]
}

...

When a load one webpage either on Win or Mac the text Mac is displayed at the top of the page...
Is there a config to change in order to get conditions handled or what basic stuff is wrong in the code above?

Thank you in advance for your help.
Ben

igorshmigor ·

You cannot use conditions inside of curly braces. Instead you'd have to write it like this:

1 = TEXT
[system = win]
1.value = Win
[else]
1.value = Mac
[end]
denba ·

Great thanks for your help.
Now it works fine.

igorshmigor schrieb

You cannot use conditions inside of curly braces. Instead you'd have to write it like this:

1 = TEXT
[system = win]
1.value = Win
[else]
1.value = Mac
[end]