[Typo3] Not render something if a menu is empty.

Peter Klein peter at umloud.dk
Tue Feb 22 15:48:46 CET 2005


"Ries van Twisk" <typo3 at rvt.dds.nl> skrev i en meddelelse 
news:mailman.293.1109081351.24686.typo3-english at lists.netfielders.de...
> Peter Klein wrote:
>
>>Hi Ries
>>You can test if a menu object is empty with ".if.isTrue < YourMenuObject" 
>>Like in this example:
>>-- cut --
>>temp.tstmenu = HMENU
>>temp.tstmenu {
>>  entryLevel = 1
>>  # Do NOT put "wrap" here!!
>>  1 = TMENU
>>  1 {
>>    wrap = <div style="border:1px solid black">Testmenu<br>|</div>
>>    NO {
>>      AllWrap = |<br>
>>    }
>>  }
>>}
>>
>>temp.menu = TEXT
>>temp.menu.value = <br>Menu is EMPTY!!<br>
>>temp.menu.if.isTrue < temp.tstmenu
>>
>>page.10 < temp.menu
>>
>>-- cut --
>>
>
> thank yo for the information.
> The problem is however that I want do remove something else instead of the 
> menu itself
> so the TS code 'temp.menu.if.isTrue < temp.tstmenu' does not work for me.

Hi Ries. That's more or less what my TS example does..

The "temp.tstmenu" is the menuobject.
"temp.menu" is an entirely diffrent object. (Maybe I shouldn't have named it 
temp.menu)

If the menuobject "temp.tstmenu" is empty, then the "temp.menu" object will 
be rendered.
To reverse it, so that "temp.menu" is rendered when "temp.tstmenu" is NOT 
empty, you just add a "if.negate = 1"

Like this:

temp.menu = TEXT
temp.menu.value = <br>Menu is NOT EMPTY!!<br>
temp.menu.if.isTrue < temp.tstmenu
temp.menu.if.negate = 1

-- 
Peter Klein/Umloud Untd


 





More information about the TYPO3-english mailing list