[Typo3-dev] TypoScript - Conditions / IF
Michael Fritz
Michael.Fritz at target-e.de
Tue Jul 19 13:49:52 CEST 2005
i would say:
[styles.content.getBorder = '']
...
[ELSE]
...
[END]
should work, try it!
-----Ursprüngliche Nachricht-----
Von: typo3-dev-bounces at lists.netfielders.de
[mailto:typo3-dev-bounces at lists.netfielders.de]Im Auftrag von Philippe
Gagnon
Gesendet: Montag, 18. Juli 2005 18:09
An: List for Core-/Extension development
Betreff: Re: [Typo3-dev] TypoScript - Conditions / IF
2005/7/16, Brian Slezak <Brian.Slezak at cor.org>:
> Hey all, trying this post on the dev list.
>
> Hoping that someone can help me find a solution to this. What I want to do is determine if a page has content in the border column. If yes, use border column content, if no, use predefined content.
>
> pseudoTS
>
> [if styles.content.getBorder not Empty]
> page.20 < styles.content.getBorder
> [else]
> page.20 = RECORDS
> page.20.tables = tt_content
> page.20.source = 1234
> [end]
>
> The above is using conditional statements, and I realize this is not the way I'll actually accomplish this, but it was easier to express what I wanted. ;)
>
> It would seem to me that TypoScript would be the best place to accomplish this in, rather than design a custom cObject or other PHP script, but that's the direction I need to find.
>
> Thanks all.
>
> ------
> Brian Slezak
>
> _______________________________________________
> Typo3-dev mailing list
> Typo3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>
Hey there,
I cannot help you on the line "[if styles.content.getBorder not
Empty]" maybe somebody can.
However, as you seem to know , they are no real if statement as
typoscrip isnt a programation langage.
the way to do this is setting
page.20 = RECORDS
page.20.tables = tt_content
page.20.source = 1234
and after...
[your condition]
(all the parameters after this line to the end of the file will be set
if your condifiton is true)
page.20 < styles.content.getBorder
as you can see this can be quite tricky for multi conditions...
I think the best way to get trough would be to create a separate
template file and do the conditon here, then link the template and do
the
subparts.your_border < the element from your seperate template
Maybe somebody can suggest a better way of doing it?
good luck
Philippe
_______________________________________________
Typo3-dev mailing list
Typo3-dev at lists.netfielders.de
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
More information about the TYPO3-dev
mailing list