[Typo3] conditionnal output and TemplaVoila
Grégory Duchesnes
gregory at icilalune.com
Sat Dec 17 11:43:18 CET 2005
Hi all,
I found tons of examples of conditionnol output with classical border
system. Among those examples is the one found in the FAQ here :
http://typo3.org/documentation/mailing-lists/english-main-list-archive/thread/229/?tx_maillisttofaq_pi1%5Bmode%5D=4&tx_maillisttofaq_pi1%5Bsword%5D=isTrue&tx_maillisttofaq_pi1%5Banswered_only%5D=0
(entitled "Display a content only if it is not empty and wrap it into a
table" in case above link is broken")
Though i couldn't find any example of the same thing done with
TemplaVoila (and believe me i've been searching hard for the last 2 weeks).
Here is what i'm trying to do :
I have a div in my HTML corresponding to an optionnal content, i'd like
this div to be completely removed when no content is present. I tried
the following logic :
- map my div as OUTER
- changed the DS xml typoscript this way :
<TypoScript>
<![CDATA[
10= RECORDS
10.source.current=1
10.tables = tt_content
10.wrap = <div id="optionnal_content"> | </div>
10.ifEmpty {
wrap =
}
]]>
</TypoScript>
And of course it doesn't work :(. I also tried other variants based on
isTrue without success.
Is there a way to do this with TemplaVoilan (even simpler than that)?
Interest of this method is that the editor doesn't have to bother about
changing the template if he needs to add an optionnal content
(furthermore he might not be entitled to change the template)
Thanks for your help, i'm really considering to switch back to classical
borderstyle templates because of that and that would be a shame.
More information about the TYPO3-english
mailing list