• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Redirect to ext. URL not open in new tab/window (2.2.3.1)
PostPosted: Sun Oct 29, 2017 10:44 pm 
Offline
New Member
New Member

Joined: Fri Dec 25, 2015 4:03 pm
Posts: 9
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Redirect to ext. URL not open in new tab/window (2.2.3.1
PostPosted: Mon Oct 30, 2017 7:47 am 
Offline
New Member
New Member

Joined: Fri Dec 25, 2015 4:03 pm
Posts: 9
I looked in the case for some more. Here some more detail on the case.

I am using the following script for the navigator:

Code:
{* 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:
    {* 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>


but this code returns me in the web page source code then ...

Code:
<li class=""><a href="https://goo.gl/xxxx"><span>Bewerten Sie uns</span></a></li>


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
Code:
{if $node->target ne ""} target="{$node->target}"{/if}>
is not working ? (how can I check that)

Thanks
Hupi


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Redirect to ext. URL not open in new tab/window (2.2.3.1
PostPosted: Mon Oct 30, 2017 3:16 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Sat Apr 18, 2009 10:09 pm
Posts: 1425
Location: Maidenhead, UK
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:

Code:
{else}
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>

{/if}

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.

_________________
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Redirect to ext. URL not open in new tab/window (2.2.3.1
PostPosted: Mon Oct 30, 2017 9:03 pm 
Offline
New Member
New Member

Joined: Fri Dec 25, 2015 4:03 pm
Posts: 9
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 ...
Code:
{if $node->target ne ""} target="{$node->target}"{/if}

... to ...
Code:
{if $node->target ne " "} target="{$node->target}"{/if}

... just to see what happens. --> now all items then show in the page source code ...
Code:
... target=""

--> 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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Redirect to ext. URL not open in new tab/window (2.2.3.1
PostPosted: Mon Oct 30, 2017 9:27 pm 
Offline
New Member
New Member

Joined: Fri Dec 25, 2015 4:03 pm
Posts: 9
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Redirect to ext. URL not open in new tab/window (2.2.3.1  Topic is solved
PostPosted: Wed Nov 01, 2017 3:01 pm 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 3028
Location: The Netherlands
So, how are you calling this Menu/Navigator? (from within the page template)

Quote:
(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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Redirect to ext. URL not open in new tab/window [solved]
PostPosted: Fri Nov 03, 2017 10:01 am 
Offline
New Member
New Member

Joined: Fri Dec 25, 2015 4:03 pm
Posts: 9
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting