deutsch english
mvlcek online
software & more...
  • home
  • news
  • getsimple
    • i18n
    • navigation
      • breadcrumbs
      • left
      • top & left
      • pulldown & left
      • child pages
      • page navigation
      • independent menus
      • navigation demo
      • rendering
    • gallery
    • search
    • news
    • rss feeds
    • custom fields
    • special pages
    • math/formulas
    • pagify
    • dynamic pages
    • hits & visits
    • faq
    • editor
    • theme settings
    • less/scss
    • how to...
  • open source
  • faq
  • search
  • search (live)
  • rss
  • blog
  • sitemap
home » getsimple » navigation » child pages

Display child pages

If you want to always display all the child pages of page main1, this is easily done with

<ul><?php get_i18n_navigation('main1',1,9); ?></ul>

But if you also want to mark the menu item, if one of these child pages is selected, and display the child page's children in the menu, it is slightly complexer:

<ul>
<?php
  $bc = return_i18n_breadcrumbs(return_page_slug());
  get_i18n_navigation($bc[0]['url']=='main1'?return_page_slug():'main1',1,9);
?>
</ul>

To display all child pages of the current top menu as title, but do so only if there are child pages, use the following code:

<?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,99);
    echo '</ul>';
  }
?>

If you want to show only one level, use 1 as 3rd parameter to get_i18n_navigation.

You could show the title instead of the menu text by using $bc[0]['title'].

© 2025 mvlcek online
Powered by GetSimple