[TYPO3-dev] TypoScript: stdWrap.ifEmpty but no stdWrap.ifIsset
Oliver Hader
oh at inpublica.de
Fri Jan 12 17:55:25 CET 2007
Hi Joey,
JoH asenau wrote:
>> I'd like a stdWrap only to be executed if there is content available.
>>
>> With stdWrap.ifEmpty I can define actions for the case that there is
>> no data. But what do I have to do if if want these actions to happen
>> only *if data is set* (e.g. a stdWrap.ifIsset).
>>
>> I could use the following way, but it's not very clean:
>> 10 = TEXT
>> 10 {
>> field = somefield
>> wrap = <div class="whatever">|</div>
>> if {
>> isTrue.field = somefield
>> }
>> }
>
> required = 1
> => renders only if there is content at all
> or
> fieldRequired = somefield
> => renders only if the field somefield is not empty
Thanks! It behaves the same as "if" but it's still tricky! ;)
Now I have the following (the TEXT-object is just for testing, it could
be the result of a frontend-plugin or whatever). If the TEXT-object has
no data, it isn't wrapped and that's what I wanted.
Example:
10 = COA
10 {
20 = TEXT
20.value =
stdWrap {
required = 1
wrap = <div class="whatever">|</div>
}
}
But it could imaging something like the following example:
10 = COA
10 {
20 = TEXT
20.value =
ifNotEmpty.wrap = <div class="whatever">|</div>
}
The result is the same as above, but if there are ifBlank and ifEmpty,
why aren't there opposite operators like ifNotEmpty or ifNotBlank on the
same level?
olly
--
Oliver Hader
http://inpublica.de/
More information about the TYPO3-dev
mailing list