2013-07-24, 19:13:52
(2013-07-24, 18:05:47)Connie Wrote: I once knew how to do but I really forgot and can't find the solution in the moment, but there is a demand concerning this in the german sub-forum:
how to include a page first-level menu, which has children pages, but no content itself? So the item should not be a link, only to show the children pages?
Thanks in advance and forgive my bad memory ;=)
You need to use Custom Rendering.
Create a component e.g. navitem:
Code:
<li class="<?php echo $item->classes; ?>">
<?php if ($item->hasChildren) { ?>
<span class="nav"><?php echo htmlspecialchars($item->text); ?></span>
<a href="<?php echo htmlspecialchars($item->link); ?>">
<?php echo htmlspecialchars($item->text); ?>
</a>
<ul><?php $item->outputChildren(); ?></ul>
<?php } else { ?>
<?php } ?>
</li>
Call the navigation function like this:
Code:
<?php get_i18n_navigation(return_page_slug(),0,99,I18N_SHOW_MENU,'navitem'); ?>
And then you need some Javascript code to show/hide the submenu(s), when the user clicks on the <span>.