[TYPO3-project-4-3] Variation for TypoScript "if"
JoH asenau
info at cybercraft.de
Wed Jun 10 13:17:17 CEST 2009
>> Here follows the syntaxt for a sane version of "if":
>>
>> if = <COMPARISON>
>> if.not = <boolean>
>
> [SNIP]
>
> I think that's still as confusing as the current version.
Mee too. The stuff you posted makes it even more complex than it already is.
Based on the current TS syntax I could imagine a more simplifying approach:
True, false and positive ould stay as is once the useless "value" has been
removed. stdWrap could stay as well.
if.isTrue = 1
if.isFalse = 0
if.isPositive = 2
if.isTrue.data = GPvar:print
if.isFalse.data = GPvar:print
if.isPositive.data = GPvar:print
The problem with isGreaterThan and isLessThan and isInList is just the order
of values and equals could stay as is. So changing the order should be
enough - value should be treated just like it is done in TEXT elements and
the operator should not get an additional value but still stdWrap
properties:
if.value = 2
if.equals = 2
if.value = 2
if.isGreaterThan = 1
if.value = 1
if.isLessThan = 2
if.value = 1
if.isInList = 1,2,3
OR
if.field = fieldname
if.equals = 2
if.field = fieldname
if.isGreaterThan = 1
if.field = fieldname
if.isLessThan = 2
if.field = fieldname
if.isInList = 1,2,3
OR
if.field = fieldname
if.equals.field = fieldname2
if.field = fieldname
if.isGreaterThan.field = fieldname2
if.field = fieldname
if.isLessThan.field = fieldname2
if.field = fieldname
if.isInList.field = fieldname2
Negate should be kicked completely in favour of a simple "not"
if.not.isPositive.data = GPvar:print
if.value = 1
if.not.equals = 2
if.value = 1
if.not.isGreaterThan = 1
if.value = 2
if.not.isLessThan = 2
if.value = 4
if.not.isInList = 1,2,3
This would offer the possibility to AND "not" and "non not" operators as
well:
if.value = 1
if.isLessThan = 2
if.not.isInList = 1,2,3
Introducing "or" and "and" instead of just "not" would open up even more
possibilities.
if.value = 1
if.isLessThan = 2
if.or.isGreaterThan = 4
if.value = 1
if.isLessThan = 4
if.and.not.isLessThan = 2
if.or.equals = 2
This would be closer to the logic "real" programmers are used to but still
as close to the current version as possible, while simplifying the whole
stuff a bit for both programmers and integrators.
Just my 2 cents
Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
TYPO3 workshops: http://workshops.eqony.com
More information about the TYPO3-project-4-3
mailing list