Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i18n menu entries
#1
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...
Reply
#2
you mean dummy pages, or dummy parents.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
Dummy parents. I searched for this term on the net and on this forum as well, zero results (besides this thread).
Reply
#4
I think there is a plugin called child menus or something.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
Using I18N:
http://get-simple.info/forums/showthread...5#pid20325
http://mvlcek.bplaced.net/get-simple/mul...v-multiple

Or if you want to replace dummy pages' links by "#":
http://get-simple.info/extend/plugin/ts-nolink/780/
Reply
#6
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/
Reply




Users browsing this thread: 1 Guest(s)