Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Redirect page to open in a new window


Go to End


4 Posts   6105 Views

Avatar
africansafari

Community Member, 30 Posts

29 October 2009 at 2:49pm

Edited: 29/10/2009 2:50pm

Hi folks,

Is there a way with SilverStripe to add a redirect page that will open in a new window? I know there is a redirect page, but that will redirect the current window.

I know this was covered in an archived message .... http://www.silverstripe.org/archive/show/156170#post156170 .... and have found the navigation template and insert <% if is_a(RedirectorPage) %> target="_blank" <% end_if %> however unsure about how to put this in an <a> tag correctly ???

Any help much appreciated :-)

Cheers

Claire

Avatar
Mo

Community Member, 541 Posts

30 October 2009 at 4:48am

I havent used this, but I imagine it would be something like:

<a href="$Link" <% if is_a(RedirectorPage) %>target="_blank"<% end_if %>>$MenuTitle</a>

Mo

Avatar
dizzystuff

Community Member, 94 Posts

10 October 2011 at 2:13am

Just came across this thread, looking to open redirect page links in a new window - but only external redirections. Code I used successfully is

<% if is_a(RedirectorPage) %><% if RedirectionType = External %>target="_blank"<% end_if %><% end_if %>

cheers

Avatar
neilcreagh

Community Member, 136 Posts

14 August 2013 at 3:06am

Or that can be simplified to just

<% if RedirectionType = External %>target="_blank"<% end_if %>
since only redirector pages have a RedirectionType