Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i18n menu entries
#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


Messages In This Thread
i18n menu entries - by registration - 2015-03-28, 22:04:33
RE: i18n menu entries - by shawn_a - 2015-03-29, 00:48:22
RE: i18n menu entries - by registration - 2015-03-29, 00:52:18
RE: i18n menu entries - by shawn_a - 2015-03-29, 01:28:35
RE: i18n menu entries - by Carlos - 2015-03-29, 01:50:03
RE: i18n menu entries - by Tyblitz - 2015-03-30, 08:29:34



Users browsing this thread: 1 Guest(s)