Search the Community
Showing results for tags 'MarkupSimpleNavigation'.
-
Hi Guys, Today, for the first time I've been playing with Markup Simple Navigation. I am able to pick things up quickly, I had no issues with MSN except for dropdown, well not quite. Here's what happen... I've created 4 pages and one of parent page contain 2 child page, which would be used as drop down. Two of child menu will always be hidden inside parent ever time page loads up. Once the parent menu is clicked, this will slide down in time fashion and display two childs underneath parent. Once the child menu is clicked, it will be taken to child page and drop down will slide back up or hide the child. It worked in HTML page and It almost worked in PW, I did troubleshoot and discovered the issues. The HTML page the parent menu contain hashtag '#' inside href.... <a href="#">Parent<span>▼</span></a> This hashtag will not refresh page or reload page when clicked as I mentioned earlier, dropdown will stay hidden everytime uploads now with PW, The parent menu/page contain with link '/parent/' and if I click on this menu, the drop down will show but hides fast because page reloads. Is there a way I could get this parent page/menu with link '/parent/' turn into # with PW or MSN?
- 10 replies
-
- markupsimplenavigation
- drop down menu
- (and 2 more)
-
This is what I want to render using the MarkupSimpleNavigation module. <style> .custom-restricted-width { /* To limit the menu width to the content of the menu: */ display: inline-block; /* Or set the width explicitly: */ /* width: 10em; */ } </style> <div class="pure-menu custom-restricted-width"> <span class="pure-menu-heading">Yahoo Sites</span> <ul class="pure-menu-list"> <li class="pure-menu-item"><a href="#" class="pure-menu-link">Flickr</a></li> <li class="pure-menu-item"><a href="#" class="pure-menu-link">Messenger</a></li> <li class="pure-menu-item"><a href="#" class="pure-menu-link">Sports</a></li> <li class="pure-menu-item"><a href="#" class="pure-menu-link">Finance</a></li> <li class="pure-menu-heading">More Sites</li> <li class="pure-menu-item"><a href="#" class="pure-menu-link">Games</a></li> <li class="pure-menu-item"><a href="#" class="pure-menu-link">News</a></li> <li class="pure-menu-item"><a href="#" class="pure-menu-link">OMG!</a></li> </ul> </div> This is what I tried, <!doctype html> <html> <head> <style> .custom-restricted-width { /* To limit the menu width to the content of the menu: */ display: inline-block; /* Or set the width explicitly: */ /* width: 10em; */ } </style> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Your page title</title> <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css"> </head> <body> <div class="pure-menu custom-restricted-width"> <span class="pure-menu-heading">Yahoo Sites</span> <?php $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module $options = array( 'outer_tpl' => '<ul "pure-menu-list">||</ul>', 'list_tpl' => '<li class="pure-menu-item">||</li>', 'item_tpl' => '<a href="{url}" class="pure-menu-link">{title}</a>', ); echo $treeMenu->render($options); // render default menu ? ?> </div> </body> </html> Outputs a vertical and horizontal menu. But supposed to be just horizontal. What is wrong with my code?
-
I'm just having some trouble with my main menu, it's started happening all of a sudden across a few of my processwire sites (completely separate). I'm using MarkupSimpleNavigation to generate the menu. But when i look at the menu the Home (id 1) goes into the second position in the menu rather than the first. But when i login and check again, it's back to normal. The tree structure obviously has Home as the root. <?php $topMenu = $pages->find('id=1|1018|1026|1019|1020|1021|1023, sort=sort'); ?> <?php $treeMenu = $modules->get('MarkupSimpleNavigation'); $currentRoot = $page->rootParent(); echo $treeMenu->render( array('max_levels'=>1, 'parent_class'=>'parent', 'current_class' => 'current'), null, $topMenu ); ?> This is the code i'm using to generate the menu. Any help on this would be great. Thanks