<!-- Navigationbar --><div class="w3-bar w3-black"> <div id="navbar" class="w3-bar-block w3-sand w3-hide w3-hide-large w3-hide-medium"> <a href="#" class="w3-bar-item w3-button w3-hover-blue">Link 1</a> <a href="#" class="w3-bar-item w3-button w3-hover-blue">Link 2</a> <a href="#" class="w3-bar-item w3-button w3-hover-blue">Link 3</a> <div class="w3-dropdown-hover"> <button class="w3-button w3-sand w3-hover-sand">Dropdown</button> <div class="w3-dropdown-content w3-bar-block w3-card-4"> <a href="#" class="w3-bar-item w3-button w3-sand w3-hover-blue">Link DD1</a> <a href="#" class="w3-bar-item w3-button w3-sand w3-hover-blue">Link DD2</a> <a href="#" class="w3-bar-item w3-button w3-sand w3-hover-blue">Link DD3</a> </div> </div> <button onclick="document.getElementById('id01').style.display='block'" class="w3-button w3-right w3-black w3-hover-blue w3-hide-small w3-hide-medium">BTN-Rechts</button> </div></div>
<div class="w3-bar w3-margin-top w3-small"><?php show_menu2(2, SM2_ROOT, SM2_START, SM2_ALL, "\n".'<a href="[url]" class="w3-bar-item w3-margin-right w3-border w3-button w3-tiny w3-padding-small">[menu_title]</a>'.'', '', '', '', false, false);?></div>
$sTopNav = ''; $sItemOpen = '<li class="nav-item[if (class==menu-expand){ dropdown}][if(class=menu-current||class=menu-parent){ parent}]">'. '<div class="d-flex">'. '<a class="nav-link[if(class=menu-current){ active}]" href="[url]">'. '<span>[menu_title]</span></a>'. '[if (class==menu-expand){'. '<a class="nav-link-toggle dropdown-toggle hide-arrow ms-auto" href="#" role="button" aria-haspopup="true" aria-expanded="false"> <i class="bi bi-chevron-down"></i> </a>}]'. '</div>'; $topNav = show_menu2( 1, SM2_ROOT + $iMultiLang, // If you have First menu level /en/, /de/ , use: SM2_ROOT + $iMultiLang, SM2_ALL, SM2_ALL|SM2_NUMCLASS|SM2_PRETTY|SM2_BUFFER, $sItemOpen, '</li>', '<ul [if(level==0){class="navbar-nav"} else {class="dropdown-menu"}]>', '</ul>' ); $topNav = str_replace('class=""', '', $topNav);
<div class="w3-bar w3-black"> <div id="navbar" class="w3-bar-block w3-sand" style="display: none;"> <?php // einzelne Menupunkte $sItemOpen = '<li class="[class] w3-hide-small w3-bar-item w3-button w3-hover-blue level[level] [if(class==menu-expand&&level==0){w3-dropdown-hover}]">[if(class==menu-expand){<a href="[url]">[menu_title]</a>}else{<a href="[url]" class="w3-padding-8 level[level]">[menu_title]</a>}]'; // home-button $sTopItemOpen = '<li class="w3-border-right"><a href="'.WB_URL.'" class="w3-hover-none w3-padding-8"><i class="fa fa-home" aria-hidden="true"></i></a>'; // button rechts $sTopItemOpen .= '<li class="w3-right"><a class="w3-bar-item w3-button w3-padding-0 w3-right" href="javascript:void(0)" onclick="closeMenu()" title="Toggle Navigation Menu">Close <i class="fa fa-bars"></i></a>'; echo show_menu2( $aMenu = 1, $aStart = SM2_ROOT, $aMaxLevel = SM2_ALL, $aOptions = SM2_ALL|SM2_PRETTY|SM2_BUFFER, $aItemOpen = $sItemOpen, $aItemClose = '</li>', $aMenuOpen = '<ul class="w3-dropdown-content w3-bar-block w3-card-4 level[level]" style="max-width:180px;">', $aMenuClose = '</ul>', $aTopItemOpen = $sTopItemOpen, $aTopMenuOpen = '<ul class="w3-bar-block w3-sand">' ); ?> </div></div> <br><button onclick="showMenu()" title="Toggle Navigation Menu"" class="w3-button w3-right w3-black w3-hover-blue w3-hide-small w3-hide-medium">BTN-Rechts</button>
<script>function showMenu() { document.getElementById("navbar").style.display = "block";}function closeMenu() { document.getElementById("navbar").style.display = "none";}</script>
function menu_2array() {ob_start();show_menu2(1, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_ALLINFO, '[url]|[menu_title]|[level]|[parent]|[page_id]|[class];', '', '', '', false, false);$array_temp_raw = explode(";", ob_get_contents());array_pop($array_temp_raw);ob_end_clean();$array_temp_clean = array();$array_target_keys = ["url", "menu_title", "level", "parent", "page_id", "class"];for ($i=0; $i<count($array_temp_raw); $i++) { $array_temp = explode("|", $array_temp_raw[$i]); $array_changed = []; foreach ($array_temp as $index => $value) { $array_changed[$array_target_keys[$index]] = $value; } $array_temp_clean[] = $array_changed;} // forreturn $array_temp_clean;} // menu_2array()
[n] => Array ( [url] => https://xyz [menu_title] => Test [level] => 0 [parent] => 0 [page_id] => 11 [class] => menu-sibling )
was haste erneut geschickt?