GetSimple Support Forum
i18n menu entries - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13)
+--- Thread: i18n menu entries (/showthread.php?tid=7166)



i18n menu entries - registration - 2015-03-28

Hello forum!

I am running a template with an i18n menu on the side, which I configured using
Code:
get_i18n_navigation(return_page_slug(),0,99,I18N_SHOW_LANGUAGE)

This works well. However, many users of the template wish for a not-so-simple thing: They want dummy menu entries to structure their sites like this:

menu_entry1 -> links to page 1
sub_menu_entry1 -> links to page 2
menu_entry2 -> links to nothing, keeps old content displayed
sub_menu_entry_2 -> links to page 3

So, is it possible to have menu entries without a linked page (dummies),
in a way that the GetSimple users can edit these entries conveniently?

I've searched the net for a long time for this now, and I'm running out of keywords to query...


RE: i18n menu entries - shawn_a - 2015-03-29

you mean dummy pages, or dummy parents.


RE: i18n menu entries - registration - 2015-03-29

Dummy parents. I searched for this term on the net and on this forum as well, zero results (besides this thread).


RE: i18n menu entries - shawn_a - 2015-03-29

I think there is a plugin called child menus or something.


RE: i18n menu entries - Carlos - 2015-03-29

Using I18N:
http://get-simple.info/forums/showthread.php?tid=2662&pid=20325#pid20325
http://mvlcek.bplaced.net/get-simple/multi-level-navigation/nav-multiple

Or if you want to replace dummy pages' links by "#":
http://get-simple.info/extend/plugin/ts-nolink/780/


RE: i18n menu entries - Tyblitz - 2015-03-30

If you simply want to have the parent (ie landing) pages not pointing to a link, I did a custom function a while ago for a client; might work for you, eventually with some tweaking:

Code:
function i18nMenuNoLandingPages($links, $loop = 0) {
    $y = count($links);
    static $str = '';
    $str = $str . '<ul>';
    for ($x = 0; $x < $y ; $x++) {
      $item = $links[$x];
      $str = $str . '<li>';
      if ($item['haschildren']) {
        $str = $str . '<a>' . $item['title'] . '</a>';
        $str = i18nMenuNoLandingPages($item['children'], $loop++, $str);
      } else if ($item['haschildren'] === false) {
        $str = $str . '<a href="' . $item['url'] . '">' . $item['title'] . '</a>';
      }
      $str = $str . '</li>';
    }
    $str = $str . '</ul>';
    return $str;
  }

Launch like so:
Code:
$nav = return_i18n_menu_data(return_page_slug(),0,5,I18N_SHOW_NORMAL);
  i18nMenuNoLandingPages($nav);

The $loop variable is for the levels of nesting you want to make parent pages 'linkless'.
I also wrote some more comprehensive doc. on i18n nav: http://codepen.io/Webketje/full/VYbxmy/