WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • show_menu2 without target attribute
  • Print
Pages: [1]   Go Down

Author Topic: show_menu2 without target attribute  (Read 5556 times)

spida

  • Guest
show_menu2 without target attribute
« on: April 03, 2008, 10:26:28 AM »
Hi,

if anyone ever wondered - like me - how to get rid of the target attribute which is automatically generated by show_menu2: Here's a brief (german) description of my solution
http://www.rot65.de/dokuwiki/doku.php/cms/WebsiteBaker/debug#attribut_target_entfernen

Regards,
Ayshe
Logged

brofield

  • Guest
Re: show_menu2 without target attribute
« Reply #1 on: April 10, 2008, 05:12:07 AM »
To do this without modifying the code, you just specify the format string.
See the documentation.
http://code.jellycan.com/files/show_menu2-README.txt

e.g. equivalent to show_menu2() but with a different format string.
show_menu2(0, SM2_ROOT, SM_CURR+1, SM2_TRIM, '[ li]<a href="[url]">');

(note: remove extra space between [ and li] to use this string)
« Last Edit: April 18, 2008, 04:58:28 AM by brofield »
Logged

spida

  • Guest
Re: show_menu2 without target attribute
« Reply #2 on: November 28, 2008, 03:21:43 PM »
Hi brofield,

I tried your line of code, but it doesn't work for me.

If I have SM2_TRIM in it, the target attribute is removed, but also my style definitions for the list and anchor elements are ignored, thus the navigation is displayed incorrect.

If I leave out SM2_TRIM, style sheets are applied correctly but the target attribute is there again.

Do you have any idea what might be the cause? How else can I get rid of the target attribute?

Best regards,
spida
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: show_menu2 without target attribute
« Reply #3 on: November 28, 2008, 03:35:28 PM »
Hello Spida,
there is really no need to prepare the showMenu-2 Module Files in order to get rid of the target attribute.

If you use the standard call
Code: [Select]
<?php show_menu2(); ?>then yes.

Also if you use something like this  [a] or [ac] in your sm2-call.

But you can also use:
'<a class="[class]" url="[url]" target="[url]">[menu_title]<a>'

Please study the show_menu2 Read-Me Files.

Here in German:
http://addons.WebsiteBaker.org/media/download_gallery/show_menu2-4.5_README-de.txt

Regards,
Stefek

Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

spida

  • Guest
Re: show_menu2 without target attribute
« Reply #4 on: December 02, 2008, 11:41:27 PM »
Hi Stefek,

I have studied the readme several times and tried various code combinations, nothing works. Either my navigation is completely destroyed or it still has the target attribute.

I also tried:
Code: [Select]
<?php show_menu2(&#39;<li><a class="[class]" url="[url]">[menu_title]</a></li>&#39;); ?>
Result: target is still rendered as attribute (with empty value).

Somehow I seem to have overseen something relevant. Can you help me a little further please?

Cheers,
spida
Logged

Offline BerndJM

  • Posts: 1764
  • Gender: Male
Re: show_menu2 without target attribute
« Reply #5 on: December 03, 2008, 12:17:27 AM »
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: [Select]
<?php show_menu2(0, SM2_ROOT, SM2_ALL, SM2_TRIM|SM2_PRETTY, &#39;<li><a class="[class]" href="[url]">[menu_title]</a>&#39;); ?>
Also the </li> is not necessary in $aitemOpen, because it's the default value for $aItemClose.

Regards Bernd
« Last Edit: December 03, 2008, 12:24:03 AM by BerndJM »
Logged
In theory, there is no difference between theory and practice. But, in practice, there is.

spida

  • Guest
Re: show_menu2 without target attribute
« Reply #6 on: June 10, 2009, 06:57:23 PM »
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: [Select]
show_menu2(0,39,SM2_ALL, SM2_ALL, SM2_TRIM|SM2_PRETTY);Still, the target attribute is shown.  

I also tried this:
Code: [Select]
show_menu2(0,39,SM2_ALL, SM2_ALL, SM2_TRIM|SM2_PRETTY, '<li><a href="[url]">[menu_title]</a></li>');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: [Select]
show_menu2(0,39,1,true,'[li]<a href="[url]">[menu_title]</a>');
Cheers,
spida
« Last Edit: June 10, 2009, 07:10:16 PM by spida »
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • show_menu2 without target attribute
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2