WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: Xagone on March 22, 2011, 06:44:00 PM

Title: wtf multi menu problems
Post by: Xagone on March 22, 2011, 06:44:00 PM
one of my install of wb 2.8.1 have a strange behavior with show_menu2...

the first menu would not allow
Code: [Select]
show_menu2(1,SM2_ROOT+1, SM2_ALL, SM2_ALL|SM2_BUFFER,'[li][a][menu_title]</a>','</li>','[ul]','</ul>','<ul id="nav" class="dropdown dropdown-horizontal">'); and would output something like
Code: [Select]
<ul id="nav" class="dropdown dropdown-horizontal"></ul><ul><ul class="menu-top">... rest of the good code
i've circumvent this problem with this code :
Code: [Select]
$lemenu = show_menu2(1,SM2_ROOT+1, SM2_ALL, SM2_ALL|SM2_BUFFER,'[li][a][menu_title]</a>','</li>','[ul]','</ul>');
echo str_replace('<ul class="menu-top">', '<ul id="nav" class="dropdown dropdown-horizontal">',$lemenu);

but now, we need to add multimenus (activated) with 1 and 2...

no... other... show_menu(X will f'ing work...

I've included the template... I dont event know what to do anymore, normaly I have no problems, but this template is a b...

any clue?

[gelöscht durch Administrator]
Title: Re: wtf multi menu problems
Post by: Ruud on March 22, 2011, 11:52:22 PM
Hi Olivier,
Your post is not very clear to me..

I know the feeling of things (like show_menu2() ) not working "as you think it should work" very well. In the end there is always a solution  8-)

Could you explain (in a way we Europeans understand too) what the problem is?
Title: Re: wtf multi menu problems
Post by: Ruud on March 22, 2011, 11:56:46 PM
Just a hint after looking in the attached template..
Code: [Select]
<?php  show_menu2(2,SM2_ROOT+1SM2_ALLSM2_ALL|SM2_BUFFER,false,false,&#39;<ul class="avmenuacc">&#39;,&#39;</ul>&#39;); ?>It has the SM2_BUFFER option in there. It means it will return (not output) the second menu. Is that the problem?
Title: Re: wtf multi menu problems
Post by: Xagone on March 23, 2011, 01:07:59 PM
I had to return the menu as buffer because the normal output was problematic and needed to str_replace and repair the output...

because if I tried :
Code: [Select]
show_menu2(1,SM2_ROOT+1, SM2_ALL, SM2_ALL,'[li][a][menu_title]</a>','</li>','[ul]','</ul>','<ul id="nav" class="dropdown dropdown-horizontal">'); the output is... :
Code: [Select]
<ul class="menu-top">
<ul id="nav" class="dropdown dropdown-horizontal">
  </li>
  <li class="menu-sibling"><a href="http://www.mocommunication.com/parcbsl/pages/fr/mission.php" title="Mission" target="_top">Mission</a></li>
  <li class="menu-sibling"><a href="http://www.mocommunication.com/parcbsl/pages/fr/services.php" title="Services" target="_top">Services</a></li></ul>

so I had to workaround.....
Title: Re: wtf multi menu problems
Post by: Ruud on March 23, 2011, 01:23:03 PM
Ok, but the second one has the buffer option enabled, but the data is not captured or used anywhere.
That would be the reason you do not see the second menu.
Title: Re: wtf multi menu problems
Post by: Xagone on March 23, 2011, 04:10:43 PM
even without buffer, or capture or echoed, no data is output, no error... nothing