WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
Here are some really nice free responsive templates: http://WebsiteBaker.at/wb-templates/
http://WebsiteBaker.at/wb-templates/search/top30-downloads.html Is this particular template responsive? I like the left column. I would like to add submenu to it. The submenu needs to appear on all pages. How can I do that? How will it shows on mobile screen if I do? This venture proved to be more challenge than I realised.
Hi,the template repository shows its pages in the last template you personally tested, so nobody else knows which template you mean. Please tell us the name of the template.
Generally spoken, a left column for showing the sub navigation is not particularly needed as all childpages are listed in the main navigation bar.
Have a look at the index.php of the template, at line 91ff. you'll find two show_menu calls.
Looks for me like an error with the ' signs in the SM2 call.
<?phpshow_menu2( $aMenu = 0, $aStart = SM2_ROOT, $aMaxLevel = SM2_CURR+1, $aOptions = SM2_TRIM, $aItemOpen = '[li][a][menu_title]</a>', $aItemClose = '</li>', $aMenuOpen = '[ul]', $aMenuClose = '</ul>', $aTopItemOpen = false, $aTopMenuOpen = false )
<?phpshow_menu2( $aMenu = 0, $aStart = 19, $aMaxLevel = SM2_ALL, $aOptions = SM2_ALL, $aItemOpen = '<li class="[class]">[a][menu_title]</a></li>', $aItemClose = '', $aMenuOpen = '', $aMenuClose = '', $aTopItemOpen = false, $aTopMenuOpen = false )
Furthermore, it usually doesn't make sense to hardcode the page id for the start of a submenu into the template. In your code (if it would be working), you would see the childpages of page 19 on every other page too. I'm not sure if it is that what you wanted to reach.The menu configuration is probably the most complicated point of building a WB template. You will find more information and typical menu calls here in the forum (german)
<?php// create main menue $sMainNavi = show_menu2( 1, SM2_ROOT, SM2_START + 1, SM2_ALL|SM2_PRETTY|SM2_CURRTREE|SM2_BUFFER, '<li class="[class]"><a href="[url]" class="[class]" title="">[if(class==menu-current && level>1){&#10144; }][menu_title]</a>', '</li>', '<ul class="[class]">', '</ul>', '<li class="[class]"><a href="[url]" class="[class]" title="">[menu_title]</a>', '<ul class="[class]">' );// create sub menue title $sSubNaviTitle = show_menu2( 1, SM2_ROOT, SM2_START, SM2_TRIM|SM2_BUFFER, '[if(class = menu-current || class = menu-parent){[menu_title]}]', '', '', '', '', '' );// remove possible comments and whitespaces from result $sSubNaviTitle = trim(preg_replace('/<\!--.*?-->/siu', '', $subMenuTitle));// create main menue sub $sSubNavi = show_menu2( 1, SM2_ROOT+1, SM2_CURR+1, SM2_SIBLING|SM2_CURRTREE|SM2_PRETTY|SM2_BUFFER, '[li][ac][if(class==menu-current){&#10144; }][menu_title]</a>', '</li>', '<ul>', '</ul>', '', '' );// remove possible comments and whitespaces from result $sSubNavi = trim(preg_replace('/<\!--.*?-->/siu', '', $sSubNavi));// show allecho '<div>'.$mainNavi.'</div>';// [...] output something othersif ($sSubNavi) { // show submenu only if sub items exists echo '<div>'.$sSubNaviTitle.'</div>'; echo '<div>'.$sSubNavi.'</div>';}
/*Menüs*/ ob_start(); show_menu2( $aMenu = 0, $aStart = SM2_ROOT, $aMaxLevel = SM2_START, $aOptions = SM2_ALL, $aItemOpen = '<li class="[class]"><a href="[url]" class="[class]"><span>[menu_title]</span></a>', $aItemClose = '</li>', $aMenuOpen = '<ul>', $aMenuClose = '<li class="ulend"></li></ul>', $aTopItemOpen = true, $aTopMenuOpen = '<ul id="mobile" class="nav">' ); $topmenu = ob_get_contents(); ob_end_clean(); $childpages = ''; ob_start(); show_menu2(0,19, SM2_ALL, SM2_ALL, '<li class="[class]">[a][menu_title]</a></li>', '', '', '', ''); $childpages = ob_get_contents(); ob_end_clean();
<div id="leftboxdesktop" class="leftbox desktops_only"><div class="inner">
<div id="leftboxdesktop" class="leftbox"><div class="inner">
How does your site structure looks like? Is page #19 in the root or ab sub page of another page? Do you use different menues?Which WB version do you use? If it is very, very old, there might have been changes to the sm2 module (which might explain why your existing code works and the new one doesn't).