[Typo3] if testing for a part of COA

Christian Lerrahn typo3 at penpal4u.net
Wed Nov 23 00:39:44 CET 2005


On Mon, 21 Nov 2005 13:37:12 +0100
"JoH" <info at cybercraft.de> wrote:

> > I've asked that question before on the German Typo3 list but the
> > suggestions I got, didn't work. So I'll give the slightly(?) extended
> > community on the English list another try as well. ;-)
> >
> > I have an object looking like this.
> >
> > temp.bildRechts = COA
> > temp.bildRechts {
> >  10 = HTML
> >  10.value = <table cellpadding="0" cellspacing="0"
> >  class="rechtsBox"><tr> 20 = HTML
> >  20.value = <td><p class="illuheader">
> >  30 = HTML
> >  30.value.field = title
> >  40 = HTML
> >  40.value = </p></td></tr><td>
> >
> >  50 < styles.content.getRight
> >
> >  60 = HTML
> >  60.value = </td></tr>
> >  70 = HTML
> >  70.value = </table>
> > }
> >
> > What I want to do now is add an if to the COA, so that the whole COA
> > doesn't exist if temp.bildRechts.50 is empty, i.e.
> > styles.content.getRight is empty. However, I don't know what an if
> > would look that checks for the content of a child object or even for a
> > different COA's content like styles content.getRight.
> >
> > Any suggestions?
> 
> Yes: Don't use HTML elements like you did!  - This is a typical scenario for
> dataWrap.

I already guessed that what I did wasn't too nice but I didn'T know how
to do it better ;-) Sometimes you just don't know where to start
searching in TSRef... :-(

> You can do it like this:
> 
> temp.bildRechts = COA
> temp.bildRechts {
>   stdWrap.dataWrap (
>     <table cellpadding="0" cellspacing="0" class="rechtsBox">
>         <tr><td>
>         <p class="illuheader">
>             {page:title}
>         </p>
>         </td></tr>
>         <tr><td>
>             |
>         </td></tr>
>     </table>
>   }
>  stdWrap.required = 1
>  10 < styles.content.getRight
> }
> 
> Though I am not sure if "required" works here, since it might consider the
> COA as "not empty" due to the page:title inside the dataWrap.
> If this is the case you can use numRows like described before in this
> thread.

The thing with required works perfectly. If I correct the typo (there's
a "}" instead of ")") this is exactly what I want.

Christian

-- 
    Dienet  dem  Herrn  mit  Freuden,  kommt  vor  sein Angesicht mit
    Frohlocken!
    
    Psalm 100,2
    
    Was ihr auch tut, das tut alles zu Gottes Ehre.
    
    1.Korinther 10,31
    



More information about the TYPO3-english mailing list