Hello.
I made a horizontal site menu and some of the pages have a submenu. I did that with Child Menu plugin and I couldn't sort it, so I started using this plugin.
However, there is a little problem. If the submenu has any content, it's ok. But if there is no content in the submenu, there is still visible an empty div (it has a background). I didn't have this problem with Child Menu and I don't know why.
How can I make the submenu (including the wrapper - div, nav and ul) visible only when there is a content of the submenu?
For illustration here you are a screenshot of the full (upper part of the image) and empty div (lower part of the image). I want the div for submenu hidden if there is no menu inside. Look at it here http://i50.tinypic.com/dw85t3.png
The code of the submenu is here:
I don't mind using much more simple code for the submenu, which is:
Thank you for you help, it's much appreciated. I saw some jquery ideas about this, but I prefer not using jquery. Furthermore, I'm not able to use it correctly :/
Edit:// Found the solution myself after careful looking at the code... I just edited the code for the submenu so that the function generated everything including the <div id="c_subMenu">
I made a horizontal site menu and some of the pages have a submenu. I did that with Child Menu plugin and I couldn't sort it, so I started using this plugin.
However, there is a little problem. If the submenu has any content, it's ok. But if there is no content in the submenu, there is still visible an empty div (it has a background). I didn't have this problem with Child Menu and I don't know why.
How can I make the submenu (including the wrapper - div, nav and ul) visible only when there is a content of the submenu?
For illustration here you are a screenshot of the full (upper part of the image) and empty div (lower part of the image). I want the div for submenu hidden if there is no menu inside. Look at it here http://i50.tinypic.com/dw85t3.png
The code of the submenu is here:
Code:
<div id="c_subMenu">
<nav>
<ul>
<?php
$bc = return_i18n_breadcrumbs(return_page_slug());
$slug = $bc[0]['url'];
$pages = return_i18n_pages();
if (@$pages[$slug]['children']) {
echo '<h3>'.$bc[0]['menu'].'</h3>';
echo '<ul class="sidemenu">';
get_i18n_navigation(return_page_slug(),1,1);
echo '</ul>';
}
?>
</ul>
</nav>
</div>
I don't mind using much more simple code for the submenu, which is:
Code:
<div id="c_subMenu">
<nav>
<ul>
<?php get_i18n_navigation(return_page_slug(),1,1); ?>
</ul>
</nav>
</div>
Thank you for you help, it's much appreciated. I saw some jquery ideas about this, but I prefer not using jquery. Furthermore, I'm not able to use it correctly :/
Edit:// Found the solution myself after careful looking at the code... I just edited the code for the submenu so that the function generated everything including the <div id="c_subMenu">
Code:
<?php
$bc = return_i18n_breadcrumbs(return_page_slug());
$slug = $bc[0]['url'];
$pages = return_i18n_pages();
if (@$pages[$slug]['children']) {
echo '<div id="c_subMenu">';
echo '<nav>';
echo '<h3>'.$bc[0]['menu'].'</h3>';
echo '<ul class="sidemenu">';
get_i18n_navigation(return_page_slug(),1,1);
echo '</ul>';
echo '</nav>';
echo '</div>';
}
?>
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
» The little I did for GetSimple