WebsiteBaker Support (2.8.x) > Templates, Menus & Design
Resposive or mobile friendly template
instantflorian:
The following finally should do the trick. It shows in the left column permanently all child items of page 19.
--- Code: ---
/*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();
--- End code ---
In the 2nd menu call it's important that there's no " ,'' " after the 2nd SM2_ALL! Otherwise you well get the wrong "[a] [menu]" output. I've tested it.
You should maybe change the line
--- Code: ---<div id="leftboxdesktop" class="leftbox desktops_only"><div class="inner">
--- End code ---
to
--- Code: ---<div id="leftboxdesktop" class="leftbox"><div class="inner">
--- End code ---
otherwise the left column is not displayed on mobile devices.
applepie:
Hi, thanks for these. I tried DarkVioer's suggestion and my page came out blank. Tried instantflorian's codes and only the main horizontal menu showing, not the submenus. Here is my index file. I can't understand what is going on.
instantflorian:
No idea what's wrong, sorry. It's exactly the same code as in my test website, where it is working like (I guess) it should.
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).
applepie:
Hi, the version may be an issue. It is a fairly old version 2.7. Could this be the problem? The present site works perfectly but it is not responsive. I am trying to update the template only without going through too much trouble.
Thanks.
applepie:
--- Quote from: instantflorian on May 17, 2015, 06:57:24 PM ---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).
--- End quote ---
Hi, I got it working now using below:
$childpages = '';
ob_start();
show_menu2(0, SM2_ROOT+1, SM2_START, SM2_ALL, '<li class="[class]">[a][menu_title]</a></li>', '', '', '', '');
$childpages = ob_get_contents();
ob_end_clean();
The only thing is that all my submenus have bullet points which I do not want. Can you tell me how to remove them.
Thanks
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version