WebsiteBaker Support (2.8.x) > Templates, Menus & Design

show_menu2 without target attribute

<< < (2/2)

BerndJM:
Sorry spida,

you're joking with this call you postet above?
You really give the string for $aItemOpen as the first and only parameter  :? that will never work in the expected way.
You have to give the SM2 function acomplete parameter list!
Up to $aFlags all the parameters are mandatory.

What happens with a call like yours?
SM2 sees the first parameter is not a number and set it to a default value (0), than it sees there are no other parameters following and sets all to it's default values ... and ... the "target is back again.

Try this:

--- Code: ---<?php show_menu2(0, SM2_ROOT, SM2_ALL, SM2_TRIM|SM2_PRETTY, &#39;<li><a class="[class]" href="[url]">[menu_title]</a>&#39;); ?>
--- End code ---

Also the </li> is not necessary in $aitemOpen, because it's the default value for $aItemClose.

Regards Bernd

spida:
Hi,

although this a really old thread I am still busy (or rather busy again) with the unwante target attribute.
Right now I am using WB 2.7 and the following code for a menu

--- Code: ---show_menu2(0,39,SM2_ALL, SM2_ALL, SM2_TRIM|SM2_PRETTY);
--- End code ---
Still, the target attribute is shown.  

I also tried this:

--- Code: ---show_menu2(0,39,SM2_ALL, SM2_ALL, SM2_TRIM|SM2_PRETTY, '<li><a href="[url]">[menu_title]</a></li>');
--- End code ---
with the same disappointing result.
As much as I appreciate the menu2 mod, this target stuff really sucks.

Best would be anyway to remove the target setting in the backend at the page settings. There is no need for my customers ever to set a target on a menu item. I had expected WB 2.7 to have gotten rid of that thing, but no, it didn't.

Anyway, if anyone still can think of another way to explain this to me, I would be very pleased.

EDIT

I got it now. This is the code that works for me:

--- Code: ---show_menu2(0,39,1,true,'[li]<a href="[url]">[menu_title]</a>');
--- End code ---

Cheers,
spida

Navigation

[0] Message Index

[*] Previous page

Go to full version