[TYPO3] if/else stdWrap conditional

Christian Vetter Christian.Vetter at dragoner-design.de
Thu Apr 6 15:59:02 CEST 2006


Hi Josh,
I assume the else of your if/else is 'subtitle // title'. My advice is  
based on that assumption, and it's untested.
Make SITE_TITLE a COA and put two TEXT objects in it - the first returning  
'subtitle // title', the other containing your condition. The second  
object will get the required flag set to 1 and a wrap providing the  
seperator you want. Now the value for the second TEXT will be dependant on  
whether or not the page is the site root. If it is, the value will be  
empty, and due to the required flag the wrap won't be shown either.
Hope this helps, because I can't view the TSref right now and I've never  
done that - thus no sample code.

Best regards,
Christian


Am 06.04.2006, 15:36 Uhr, schrieb Wester, Josh  
<JoshuaWester at creighton.edu>:

> I am trying to essentially accomplish an if/else in typoscript. I want
> SITE_TITLE to return "subtitle : leveltitle:0" unless the current page
> is the root page of the site. I have tried various other methods with no
> success and came up with following code. This code makes sense to me,
> but TYPO doesn't seem to like it. All SITE_TITLE returns is
> leveltitle:0.
>
> 	# Get Site Title
> 	subparts.SITE_TITLE = TEXT
> 	subparts.SITE_TITLE {
> 	    data = leveltitle:0
> 	    stdWrap.field = subtitle // title
> 	    stdWrap.noTrimWrap = || :|
> 	    stdWrap.if {
> 	        value.data = leveluid:0
> 	        equals.field = uid
> 	        negate = 1
> 	    }
> 	}
>
> I would really appreciate any help anyone can give me.
> Thanks,
>
> Josh



More information about the TYPO3-english mailing list