[TYPO3-english] stdWrap.required with undefined constants

Bernd Wilke t3ng at pi-phi.tk
Mon Feb 20 08:27:56 CET 2012


On 02/17/2012 10:10 PM, Steffen Gebert wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> do you know a way, how to handle undefined constants with stdWrap.required?
>
> Constants:
> myconfig.foo = bar
>
> Setup:
> a = TEXT
> a.value = {$myconfig.foo}
> a.required = 1
>
> I have a setup, where myconfig is cleared on every sub-site, thus it
> turned out that introducing a new config option below myconfig isn't
> that easy and I have to add an empty
> myconfig.foo =
> to every sub site.
>
> The problem is that the constant stays unreplaced, thus required sees
> "{$myconfig.foo}" as content, which is obviously not an empty string.
>
> Any way to deal with (via TS)?

you need a compare to the string '{$myconfig.foo}' unsubstituted!
you may get it with a COA or a data, where it does not get substituted, 
then you need an 'if' instead of '.required = 1'

other solution:

instead of clearing
	myconfig.foo >
redefine it empty
	myconfig.foo =

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list