Hi all,
I just have the following problem in CMS Version 2.2.3.1
- I create a new content page with type "Redirect (Weiterleitung)"
- Add a external url (example "https://forum.cmsmadesimple.org")
- Set target to "_blank"
The page opens always in the same tab/window as if "_self" would be selected as target. It does NOT open a new tab/window as it should.
I emptied the browser cache and also the site cache in CMSMS. Nothing helps so far.
I know with earlier 2.x.x versions this was working.
Could please someone tell me whether its a bug or what I may do wrong ?
Thanks
Hupi
PS: didn't find similar issue posted by using the search function. Sorry if I have overlooked something.
Redirect to ext. URL not open in new tab/window (2.2.3.1)
Re: Redirect to ext. URL not open in new tab/window (2.2.3.1
I looked in the case for some more. Here some more detail on the case.
I am using the following script for the navigator:
So a redirecting page should be using ...
but this code returns me in the web page source code then ...
The "target attribute" is not showing up in the generated code, even it is set in the content page to "_blank".
--> Where is the mistake I make in my script ? (I have no idea)
--> Or is it a bug and the is not working ? (how can I check that)
Thanks
Hupi
I am using the following script for the navigator:
Code: Select all
{* Main Menu *}
{if !isset($depth)}{$depth=0}{/if}
{strip}
{if $depth == 0}
<ul class="nav navbar-nav pull-right">
{else}
<ul class="subMenu">
{/if}
{$depth=$depth+1}
{foreach $nodes as $node}
{* setup classes for the anchor and list item *}
{$liclass=[]}
{$aclass=[]}
{* the first child gets a special class *}
{* if $node@first && $node@total > 1}{$liclass[]='first_child'}{/if *}
{* the last child gets a special class *}
{* if $node@last && $node@total > 1}{$liclass[]='last_child'}{/if *}
{if $depth == 1}
{* this is a page on level 1 *}
{$liclass[]='primary'}
{$aclass[]='firstLevel'}
{/if}
{if $node->has_children}
{* this is a parent page *}
{$liclass[]='dropdownSubmenu'}
{$aclass[]='hasSubMenu'}
{/if}
{if $node->current}
{* this is the current page *}
{$liclass[]='active'}
{$aclass[]='active'}
{/if}
{if $node->parent}
{* this is a parent of the current page *}
{$liclass[]='active'}
{$aclass[]='active'}
{/if}
{* build the menu item from the node *}
{if $node->type == 'sectionheader'}
<li class='{implode(' ',$liclass)}'><a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if}><span>{$node->menutext}</span></a>
{if isset($node->children)}
{include file=$smarty.template nodes=$node->children}
{/if}
</li>
{else if $node->type == 'separator'}
<li class="sep"></li>
{else}
{* regular item *}
<li class="{implode(' ',$liclass)}"><a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if} href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>
{if isset($node->children)}
{include file=$smarty.template nodes=$node->children}
{/if}
</li>
{/if}
{/foreach}
{$depth=$depth-1}
</ul>
{/strip}
So a redirecting page should be using ...
Code: Select all
{* regular item *}
<li class="{implode(' ',$liclass)}"><a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if} href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>
Code: Select all
<li class=""><a href="https://goo.gl/xxxx"><span>Bewerten Sie uns</span></a></li>
--> Where is the mistake I make in my script ? (I have no idea)
--> Or is it a bug and the
Code: Select all
{if $node->target ne ""} target="{$node->target}"{/if}>
Thanks
Hupi
- paulbaker
- Dev Team Member
- Posts: 1465
- Joined: Sat Apr 18, 2009 10:09 pm
- Location: Maidenhead, UK
- Contact:
Re: Redirect to ext. URL not open in new tab/window (2.2.3.1
I have tested this on a 2.2.3.1 system and it worked as expected, adding the target attribute to an external link in a menu.
The relevant bit of my menu template is:
Are you absolutely sure you are looking at/editing the correct menu template? Be sure by adding a temporary marker ("xxx") somewhere in the template, saving, and making sure that comes up on your live site.
The relevant bit of my menu template is:
Code: Select all
{else}
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>
{/if}
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation
CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
https://docs.cmsmadesimple.org/troubles ... nformation
CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
Re: Redirect to ext. URL not open in new tab/window (2.2.3.1
Hi Paul,
thanks for looking at it.
I tried now the following things:
- as suggested I added xxxx in the template to make sure it is the correct one --> the xxxx is showing up. --> confirmed. it is definitively the right one.
- checked in the database. the attribute "_blank" is in the property table and refering to the correct item id in the content table --> DB ok. property there. no problem visible (for me).
- Again went to the system maintenance and performed all possible tasks --> not a single error there eighter.
- then changed the template from ...
... to ...
... just to see what happens. --> now all items then show in the page source code ...
--> that confirms me, the IF query does add the required text. So I think the template is not the problem.
It looks to me really as if the IF clause is not doing the query in the DB.
Since I do have the exact same issue on 2 different installations (2 different provider & server) the only thing I could think of is an issue with a backend file on the servers.
Maybe a file corrupted during the last update to 2.2.3.1 or a file got corrupted when expanding the package "cmsms-2.2.3.1-install.expanded.zip" ?
I have no more ideas than that.
BR Hupi
thanks for looking at it.
I tried now the following things:
- as suggested I added xxxx in the template to make sure it is the correct one --> the xxxx is showing up. --> confirmed. it is definitively the right one.
- checked in the database. the attribute "_blank" is in the property table and refering to the correct item id in the content table --> DB ok. property there. no problem visible (for me).
- Again went to the system maintenance and performed all possible tasks --> not a single error there eighter.
- then changed the template from ...
Code: Select all
{if $node->target ne ""} target="{$node->target}"{/if}
Code: Select all
{if $node->target ne " "} target="{$node->target}"{/if}
Code: Select all
... target=""
It looks to me really as if the IF clause is not doing the query in the DB.
Since I do have the exact same issue on 2 different installations (2 different provider & server) the only thing I could think of is an issue with a backend file on the servers.
Maybe a file corrupted during the last update to 2.2.3.1 or a file got corrupted when expanding the package "cmsms-2.2.3.1-install.expanded.zip" ?
I have no more ideas than that.
BR Hupi
Re: Redirect to ext. URL not open in new tab/window (2.2.3.1
Just did some more tests:
Refreshed the installation --> no change. does not fix the problem.
Changing from php 7 to 5.6 --> no change. does not fix the problem.
Now I am totally out of ideas.
BR Hupi
Refreshed the installation --> no change. does not fix the problem.
Changing from php 7 to 5.6 --> no change. does not fix the problem.
Now I am totally out of ideas.
BR Hupi
Re: Redirect to ext. URL not open in new tab/window (2.2.3.1
So, how are you calling this Menu/Navigator? (from within the page template)
(optional) loadprops="" - Use this parameter when NOT using advanced properties in your navigator template. This will disable the loading of all of the content properties for each node (such as extra1, image, thumbnail, etc.). This will dramatically decrease the number of queries required to build a navigation, and increase memory requirements, but will remove the possibility for much more advanced displays
Re: Redirect to ext. URL not open in new tab/window [solved]
Oh man .... how stupid can one be
That was the mistake.
I saw that in the help / documentation and checked the template header and thaught "this cant be the error, because I use these optional parameters within the pages for adding the correct footer" all the time, which works fine.
Did not think to check the line where the navigator is really called from
Many thanks @Velden and and @paulbaker for your help. ANd sorry I wasted your time. Well ... wasted about 6 hours of my time too ...
CLOSED & SOLVED
That was the mistake.
I saw that in the help / documentation and checked the template header and thaught "this cant be the error, because I use these optional parameters within the pages for adding the correct footer" all the time, which works fine.
Did not think to check the line where the navigator is really called from
Many thanks @Velden and and @paulbaker for your help. ANd sorry I wasted your time. Well ... wasted about 6 hours of my time too ...
CLOSED & SOLVED