[TYPO3-project-4-3] Variation for TypoScript "if"

Martin Kutschker masi-no at spam-typo3.org
Fri Jun 12 00:24:57 CEST 2009


Tyler Kraft schrieb:
> 
> 
>> Just to get it right. You do not understand this expression?
>>
>> if = ( $a AND $b ) OR ( $c and $d )
> 
> I understand that fine but it is not what you wrote, is it? What you
> wrote was this:
> 
> if = {a} > {b} || {c}
> if.a = value:42
> if.b = object:TEXT
> if.b.value = 123
> if.c = function:inList
> if.c.needle = l
> if.c.haystack = w,o,r,d
> 
> This is far more complicated looking and the fact that you are now using
> the terms needle and haystack clearly implies a much more programmatic
> approach that would rely upon the user having programming knowledge.

Really? "haystack" and "needle" are taken from the proverb (and used in
the PHP docs). But if you like this more no problem:

if.c = function:inList
if.c.value = l
if.c.list = w,o,r,d

> As well what is the point of having two cases for 'and'?

There is no "and" in this example.

> Given the choice, what you wrote looks far more difficult to use than
> what Joey is purposing.

Tastes differ.

>> If this is so, then maybe we have to target for to groups of users.
>> Those trained in formal logic (ie programmers) and those that are not.
> 
> You already have that option - 'if' will allow you to use a function to
> do a check. so why then reinvent this wheel?

I want to write an expression directly in Typoscript where it belongs
to. TS sser functions are nice to have, but if I can I try a TS solution.

>> I tried to enhance the syntax with formal logic in mind and didn't think
>> about a natural language approach.
> 
> But that's the point of typoscript - that one doesn't need to have
> programming (or as you say formal) knowledge. It's goal as far as I
> always knew way to allow complex configuration for the non-programmer.

I got it now that you and Joey like the natural language approach.
Ernesto and me favour the formal logic approach.

Masi


More information about the TYPO3-project-4-3 mailing list