WebsiteBaker Support (2.8.x) > Templates, Menus & Design
show_menu2 without target attribute
spida:
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
brofield:
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)
spida:
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
Stefek:
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: ---<?php show_menu2(); ?>
--- End code ---
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
spida:
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: ---<?php show_menu2('<li><a class="[class]" url="[url]">[menu_title]</a></li>'); ?>
--- End code ---
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
Navigation
[0] Message Index
[#] Next page
Go to full version