We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27023
    • 36 Posts
    Hi, kiss

    Ok i have a website with a top menu and a sidebar menu. The top menu is the top level pages and the sidemenu shows the pages sub resources using ULTIMATEPARENT.

    Basically i want the submenu to show if that specific page has submenu and disappear if not. This is all well if the submenu wasnt inside a styled div but it is. So at the moment if there is no submenu items it just shows an empty styled box.

    Can i use PHx in some way to use a conditional statement on the whole DIV that detects whether there are no submenu items?

    Thanks
      • 3707
      • 241 Posts
      Are you using Wayfinder for your menus? If so, you can place your div code inside the outerTpl chunk so that it only gets displayed if the submenu exists.
        • 27023
        • 36 Posts
        ahhh! yes didnt think about that.

        Thanks i will try and get back to you.

        cheers for the response
          • 16183
          • 1,390 Posts
          Clever solution. Remember though that if the side-menu has sub-menus too (&level greater than 1), i.e. if there’s more than one level of menus there, then it is advisable to use an innerTpl for those sub-menus. If you don’t, the outerTpl will be used as the outside container of those sub-menus and you will end up with extra divs.

          cheers/k