[TYPO3-english] Typoscript variable test empty

Xavier Perseguers xavier at typo3.org
Tue Jan 17 15:06:52 CET 2012


Hi,

> I have the following typoscript code on a page. This page needs to forward
> the parameters gotten from the current request to an iframe that will be
> printed on the page:
> 5 = COA_INT
> 5.10 = TEXT
> 5.10 {
>       dataWrap = | <iframe
> src="http://www.mysite.com/?1=a&{getIndpEnv:QUERY_STRING}"></iframe>
> }
> 
> When there are no requestparameters this will result in the following
> incorrect link:
> http://www.mysite.com/1=a&
> 
> How can I first test if the getIndpEnv:QUERY_STRING isn't empty, so I know
> if I should add the extra '&'-sign to the URL. 

You should assign what you want to test to the data itself, not the
dataWrap:

5.10 = TEXT
5.10 {
	data = getIndpEnv:QUERY_STRING
}

and then play with "required" and/or "ifEmpty" to achieve what you want.
Just check the stdWrap documentation.

HTH

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-english mailing list