[Typo3] conditionnal output and TemplaVoila
Peter Klein
peter at umloud.dk
Sun Dec 18 16:59:52 CET 2005
Hi Grégory . Don't use "wrap" but one of the other wraps which has stdWrap
properties, like "innerWrap" or "outerWrap".
Then you should be able to do it like this:
-- cut --
10 = COA
10 {
10= RECORDS
10.source.current=1
10.tables = tt_content
stdWrap.outerWrap = <div id="optionnal_content"> | </div>
stdWrap.outerWrap.if.isTrue.current = 1
}
-- cut --
Note: The RECORDS object has to be inside a COA object, since the RECORDS
object doesn't have stdWrap properties..
--
Peter Klein / Umloud Untd
"Grégory Duchesnes" <gregory at icilalune.com> wrote in message
news:mailman.8676.1134838109.24100.typo3-english at lists.netfielders.de...
> Ouch!
>
> Now it does something if i use isFalse : nothing ever outputs (content or
> div tags) and even if there's a content
> Unfortunately if i use isTrue, div tags are always there even if there's
> no content.
>
> I'm going to read your links and find my way in this typoscript maze ;)
>
>
> Duch
>
> Bernhard Kraft a écrit :
>
>>Grégory Duchesnes wrote:
>>
>>
>>>I don't understand what the isFalse (or isTrue) line do? It interacts
>>>with the wrap function? and wrapping is done only if the condition is
>>>met?
>>>
>>>Do you see what could be wrong?
>>>
>>
>>".if" should output "nothing" of the cObject if the condition is not met.
>>
>>But I just had a look at :
>>
>>http://typo3.org/documentation/document-library/doc_core_tsref/RECORDS/
>>
>>and noticed it doesn't have any output. So you will most probably need
>>to use a containing COA like:
>>
>>5 = COA
>>5 {
>> # The only sub-cObj
>> 10 = RECORDS
>> 10.source.current=1
>> 10.tables = tt_content
>>
>> # Define wrapping and condition
>> wrap = <div id="optionnal_content"> | </div>
>> if.value.current = 1
>> if.isFalse = 1
>># if.isTrue = 1
>>}
>>
>>What this does is that it uses a COA (cObj Array - kind of container) to
>>"house" the
>>RECORDS cObj. And define the wrap.
>>
>>As you can read on:
>>http://typo3.org/documentation/document-library/doc_core_tsref/COBJ_ARRAY_COA_COA/
>>this cObj supports an .if property:
>>
>>if ->if if "if" returns false the COA is NOT rendered
>>
>>which means it is ABSOLUTLY NOT rendered. not even the wrapping.
>>
>>you can read about .if here:
>>
>>http://typo3.org/documentation/document-library/doc_core_tsref/if/
>>
>>
>>
>>greets,
>>Bernhard
>>_______________________________________________
>>Typo3-english mailing list
>>Typo3-english at lists.netfielders.de
>>http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>>
>>
More information about the TYPO3-english
mailing list