Search the Community
Showing results for tags 'foundation 4 menu vertical'.
-
I have been transitioning all my sites to https and noticed the first PW site I did, https://www.chicagoplumbingcode.com that uses the Foundation 4 drop in site profile is rendering the navigation menu vertically instead of horizontally. I have tried a few things including adding a class " inline-list" but no luck. Any thoughts? Just upgraded wire to 3.0.42. Code from _nav.php /** * Render a <ul> navigation list * */ function renderNav(PageArray $items, array $options = array()) { if(!count($items)) return ''; $defaults = array( 'fields' => array(), // array of other fields you want to display (title is assumed) 'class' => 'inline-list', // class for the <ul> 'active' => 'active', // class for active item 'dividers' => false, // add an <li class='divider'> between each item? 'tree' => false, // render tree to reach current $page? ); $options = array_merge($defaults, $options); $page = wire('page'); $out = "<ul class='$options[class]'>"; $divider = $options['dividers'] ? "<li class='divider'></li>" : ""; foreach($items as $item) { // if this item is the current page, give it an 'active' class $class = $item->id == $page->id ? " class='$options[active]'" : ""; // render linked item title $out .= "$divider<li$class><a href='$item->url'>$item->title</a> "; // render optional extra fields wrapped in named spans if(count($options['fields'])) foreach($options['fields'] as $name) { $out .= "<span class='$name'>" . $item->get($name) . "</span> "; } // optionally render a tree recursively to current $page if($options['tree']) { if($page->parents->has($item) || $item->id == $page->id) { $out .= renderNav($item->children("limit=50"), array( 'fields' => $options['fields'], 'tree' => true, )); } } $out .= "</li>"; } $out .= "</ul>"; return $out; }