WebsiteBaker Support (2.12.x) > General Help & Support

menu is getting a noopener REL??

(1/2) > >>

johnbroeckaert:
Hi all,

I just finished my template and all is running well exceot the fact that the menu items are getting a REL-noopener
And the do notting. If I select a menu item the browser is pointing to the right page, but it does not open.
What could be the issue? And where is the REL comming from. It is not in my CSS or JS


--- Code: ---<a href="http://localhost:4001/wbdemo/pages/WebsiteBaker-installatie.php" target="_top" rel="noopener" title="WebsiteBaker installatie">WebsiteBaker installatie</a></li>
--- End code ---

Thanks

jacobi22:
if you use the target-attribute [target] inside of a link in your show-menu-call, it's possible to add JS in this target window and maniplulate this window / system with javascript and this is a secure risk. this risk was detected from a google page tool, but, if i read this, it's only possible for target="_blank", not for the same window

this attribute rel="noopener" was added by include.php from show_menu2. If you dont need the target for special funktions (like target="_blank" in a menu-link) remove the [target]-Flag from the menu-call and try again.
Please send a replay about this.

Maybe, it needs a special condition for the target-definition in show_menu2 like

if( $this->page['target'] == '_blank'){
   $retval .= ' target="'.$this->page['target'].'" rel="noopener"';
}


German Description about the risk -> https://www.christoph-freyer.at/blog/links-absichern-mit-rel-noopener/#.XFGMDc0xm70


johnbroeckaert:
Hello @jacobi22

I do not quit understand to remove the [target] from the menu-call. The call is looking like this:

--- Code: ---<?php show_menu2(0,SM2_ROOT,SM2_ALL,SM2_ALL,'[li][a][menu_title]</a>','</li>','[ul]','</ul>',false,'<ul id="nav">');?>
--- End code ---

Of course I tryed to remove the "rel=noopener" the easy way out of the include.php file. Changed it in  "" instead of "noopener". That didn't work and messed up the menu.

johnbroeckaert:
Tryed the SM2_XHTML_STRICT parameter (added at the menu-call.
Didn't work either ;-(

jacobi22:
from the readme: [a] or [ac] set automatically the target-attribute


--- Quote ---[a]             <a> tag (no class):         '<a href="[url]" target="[target]">'
[ac]            <a> tag including class:    '<a href="[url]" target="[target]" class="[class]">'
--- End quote ---

 :wink: :wink: :wink:

use (with or without <span> )

--- Code: ---<a href="[url]" class="[class]"><span>[menu_title]</span></a>
--- End code ---

instead of [a] or [ac]

Navigation

[0] Message Index

[#] Next page

Go to full version