[Typo3] if testing for a part of COA

JoH info at cybercraft.de
Mon Nov 21 13:37:12 CET 2005


> 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.
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.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau





More information about the TYPO3-english mailing list