has-children not clickable with MarkupSimpleNavigation?
Hi,
I want to create a vertical navigation with Zurb Foundation, but the template is not the important thing. Every item which has children should not be clickable. That's important. I know, there are some Foundation profiles available. I'm just wondering, if that can easy be realised with MarkupSimpleNavigation, because I have it already installed for other navigation elements on the project and it's brilliant. I have tried to bring together the following two elements. Without success.
$treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module
$options = array(
'parent_class' => 'parent',
'current_class' => '',
'has_children_class' => 'has-dropdown',
'max_levels' => 3,
'show_root' => true,
'selector_field' => 'nav_selector',
'outer_tpl' => '<ul class="right">||</ul>',
'inner_tpl' => '<ul class="dropdown">||</ul>',
'list_tpl' => '<li%s>||</li>',
'code_formatting' => true
);
echo $treeMenu->render($options, $page, $rootPage); // render default menu
$has_children = count($child->children) ? true : false;
if($has_children && $child !== $root) {
$class .= 'has-dropdown'; // sub level Foundation dropdown li class
$childUrl = "#"; // stop parents being clickable
} else {
$childUrl = $child->url; // if does not have children, then get the page url
}
Can that be done with MarkupSimpleNavigation? I cannot get it work, but I'm not really firm in PHP. Thank you for your help!