[TYPO3-english] Hide submenu when no submenu items

Mark Janssen pixxel_ at live.nl
Thu Dec 23 10:51:01 CET 2010


Hi everyone,

I have 2 problems and I hope you will help me out. This is it:
*1.* when there are no submenu items, the whole submenu wrap (so also 
the whole submenu) should not be appearing
*2.* the submenu which contains submenu items should always be "active" 
when the submenu item is clicked upon

This is the code I am using. This code is wonderful for "not showing the 
submenu when there aren't any", but then problem 2 appears.

temp.navigation = HMENU
temp.navigation {
   special = directory
   special.value = 1
   entryLevel = 1

   1 = TMENU
   1 {
     noBlur = 1
     wrap = <ul> | </ul>
     NO = 1
     NO {
       wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li 
class="last">|</li>
     }
     ACT = 1
     ACT {
       wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li 
class="last">|</li>
       ATagParams = class="active"
     }
     CUR = 1
     CUR {
       wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li 
class="last">|</li>
       ATagParams = class="active"
     }
   }
}

temp.submenu < temp.navigation
temp.submenu {
   special.value.data = leveluid:1
   wrap = <div class="top"></div> | <div class="bottom"></div>

   // code for hiding submenu when there are no items in it
   if.isTrue.numRows {
     table = pages
     select {
     }
   }
}

And this is a "sketch" of what is happening right now and what I want to 
achieve:

[  main navigation ]

[submenu] [content] [another fixed menu]

So when I click on a submenu item in [submenu], the *page appears *but 
the whole *[submenu] dissapears*.

And when I *remove *the code for letting the submenu dissapear when 
there are no items in it, *problem 2 works* but then *problem 1 doesnt work.

*Problem 1: works,  problem 2: doesnt work
Problem 1: doesnt work,  problem 2: works

Please help me out, I am eating myself right now.

Thanks,

Mark Janssen


More information about the TYPO3-english mailing list