Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
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:
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... Smile I just edited the code for the submenu so that the function generated everything including the <div id="c_subMenu"> Smile
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
Reply


Messages In This Thread
rewrite language problem - by tomkop - 2013-03-27, 06:34:44
RE: Support for multilanguage sites, Internationalization (I18N) - by TeeJay - 2013-04-04, 23:40:50
Enhancement suggestion - by hameau - 2013-05-12, 04:17:12
Enhancement request - by hameau - 2013-06-14, 20:02:07
RE: Enhancement request - by mvlcek - 2013-06-14, 22:04:12
RE: Enhancement request - by hameau - 2013-06-14, 23:01:36
Duplicate language cookies bug - by enzy - 2013-08-20, 07:03:26
RE: Duplicate language cookies bug - by ohayo - 2013-08-20, 18:12:25
Plugin is not shown - by tosho - 2013-09-15, 12:10:37
1000 pages limit in i18n_navigation - by titus - 2014-10-13, 21:58:36
Bug found - by lbarsov - 2014-10-17, 03:41:53
Menu with picture - by Dimi - 2015-04-28, 16:05:45
Rendering Menu in Component - by Alexander_ - 2016-05-04, 23:06:51
Meta desc for different languages - by Alexander_ - 2017-02-14, 20:29:32
Hierarchical Menus - by celextel - 2019-07-26, 16:41:47
Ri18n_navigation - by celextel - 2021-02-19, 16:07:48



Users browsing this thread: 9 Guest(s)