SOLVED! show menu only when content available

spida

OK, I just found out that I have to apply the background-image in the CSS differently. Problem solved!  :mrgreen:

spida

#1
Hello to everyone!

I am using the following show_menu code in a template:
       <?php ob_start();     // start output buffer
        
show_menu(1,2,1,true,'<li>[a][menu_title][/a]</li>','','','','','');    // call menu
        
$foo=ob_get_contents();    // put outputbuffer in $foo
        
ob_end_clean();             // clear outputbuffer
        
if ($foo<>"") {  // some code to execute cause there is some block
          
echo '<div id="menu-page">';
          echo 
'<h3>Menu</h3>'
          echo 
'<ul>';
          echo 
$foo
          echo 
'</ul>';                              // show the block (as saved in $foo)
          
echo '</div>';
            } else { 
// some code for no info
        
}
        
?>


In the accomplishing CSS a background-image is defined for the div containing this menu.

What I need now, is a possibility to have the whole div only shown when there ARE entries for the submenu. I tried it with the else-part, exchanging // some code for no info with echo '<div id="empty"></div>';, but this didn't work.

Your help is, as always, very welcome.  :-)

Regards,
Ayshe