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
<a href="http://localhost:4001/wbdemo/pages/WebsiteBaker-installatie.php" target="_top" rel="noopener" title="WebsiteBaker installatie">WebsiteBaker installatie</a></li>
Thanks
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
Hello @jacobi22
I do not quit understand to remove the [target] from the menu-call. The call is looking like this:
<?php show_menu2(0,SM2_ROOT,SM2_ALL,SM2_ALL,'[li][a][menu_title]</a>','</li>','[ul]','</ul>',false,'<ul id="nav">');?>
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.
Tryed the SM2_XHTML_STRICT parameter (added at the menu-call.
Didn't work either ;-(
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]">'
:wink: :wink: :wink:
use (with or without <span> )
<a href="[url]" class="[class]"><span>[menu_title]</span></a>
instead of [a] or [ac]
and if you need the target in my example, use
<a href="[url]" class="[class]" target="[target]"><span>[menu_title]</span></a>
I have tried both examples. Unfortunately without consequence. The menu now gives the correct issue, so without a 'noopener' but does not switch to the desired page.
Below is a part of the menu as now in the issue of WB.
showmenu call:
<?php show_menu2(0,SM2_ROOT,SM2_ALL,SM2_ALL,'[li] <a href="[url]" class="[class]"><span>[menu_title]</span></a>','</li>','[ul]','</ul>',false,'<ul id="nav">');?>
showmenu output:
<ul id="nav">
<li class="menu-first">
<a href="http://localhost:4001/wbdemo" class="menu-first"><span>Home</span></a>
etc.
</li>
</ul>
I dropped the old call with <!--- and -->, but I saw in the source code that it was executed and indicated in green. I can not assume that this rule still affects the implementation of the menu?
<!-- <ul id="nav"><li class="menu-first"><a href="http://localhost:4001/wbdemo" target="_top" rel="noopener" title="HOME">Home</a></li> etc. </ul> -->
(Y) (Y)
Solved. It was a false call from within a js file.
Thank you very much for thinking with me!!
Other solution is explained in the README_en.txt starting at line 306 GROUP2
SM2_XHTML_STRICT From all links, created by [a] or [ac], the 'target' -
attribute will be removed to preserve the XHTML-Compatibility
And without a target rel=""noopener" will not be set
Dietmar