[Typo3] conditional output

Andrew Seguin asegu at borgtech.ca
Sat Nov 5 17:22:18 CET 2005


Hello typo3 users,

My question relates to the conditional displaying of objects. For
starters, I have to admit I am still quite green, I've been using typo3
for only a couple of days now. I've read through several of the documents
including getting-started, modern template building part 1, typoscript by
example and have done some looking into typoscript ref as well as a few
other documents...  What I have found in previous postings to the mailing
list I either didn't understand or did not refer to the same problem, and
google was unfortunatly not much help either on the subject of "if not
empty" "ifEmpty" in reference to typoscript... (so yes I do have a good
amount more learning to do, and I have tried to solve this on my own, to
date the answer to my problem has not made itself clear!)

what I have managed to do:
convert the html version of the template into typoscript using the modern
template building as a guide in the process, the menu works fine and
drawing content from the database works as well. I even have a new section
working well which adds a column on the right of the page based on the
border column content (which in my page is for related links).

what I have not managed to do:
I have many pages which will not have content on the right side in which
case I want nothing outputed, including the title! You can see I put the
code I'm using below, which is working except it seems for the if case.

temp.rightside.20.if.isTrue = 0
^ hides the object
temp.rightside.20.if.isTrue = 1
^ displays the object

I'd hope that if.isTrue = styles.content.getBorder would have the result
of displaying the object if there is content, not displaying when there is
no content. Am I referencing the object wrong? or is the object set under
all cases? or do I need to reference a property? or...?

I thank you for your time in advance!
Andrew

The code:
--------------------------------------------------------------------
temp.rightside.20 = COA
temp.rightside.20.if.isTrue = styles.content.getBorder
temp.rightside.20 {
   10 = TEXT
   10.value = Usefull Links
   10.wrap = <div class="title"> | </div>

   20 = CONTENT
   20 < styles.content.getBorder
   20.wrap = <div id="usefull" class="newssection"> | </div>
}
--------------------------------------------------------------------




More information about the TYPO3-english mailing list