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:

Customising the CMS /

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

Open Redirector Page in new Tab


Go to End


1993 Views

Avatar
Tawny

Community Member, 1 Post

2 October 2009 at 10:35pm

Hi Everyone,

I try to open a Redirector Page in new tab. If i do this in the main navigation, everything is working.

This is my Navigation.ss:

<ul>
 	<% control Menu(1) %>
  			<li><a href="$Link" title="$Title.XML" class="$LinkingMode"><span>$MenuTitle</span></a></li>
   	<% end_control %>
</ul>

When I change it like that:

<ul>
 	<% control Menu(1) %>
  			<li><a href="$Link" target="_blank" title="$Title.XML" class="$LinkingMode"><span>$MenuTitle</span></a></li>
   	<% end_control %>
 </ul>

every link in the navigation will open in a new tab.

But what i want is to do this in my sidebar!!

This is my Sidebar.ss:

<div id="Sidebar" class="typography">
	<div class="sidebarBox">
 		<h3>
			<% control Level(1) %>
				$Title
			<% end_control %>
  		</h3>
  		<ul id="Menu2">
		  	<% control Menu(2) %>
  	    		<% if Children %>
			  	    <li class="$LinkingMode"><a href="$Link" title="$Title.XML" class="$LinkingMode levela"><span><em>$MenuTitle.XML</em></span></a>
	  	    	<% else %>
		  			<li><a href="$Link" title="$Title.XML" class="$LinkingMode levela"><span><em>$MenuTitle.XML</em></span></a>
				<% end_if %>	  
	  			<% if LinkOrSection = section %>
	  				<% if Children %>
						<ul class="sub">
							<li>
								<ul class="roundWhite">
									<% control Children %>
									<% if ClassName = RedirectorPage %>
									<li><a href="$Link" target="_blank" title="$Title.XML" class="$LinkingMode levelb"><span><em>$MenuTitle.XML</em></span></a></li>
									<% else %>
										<li><a href="$Link" title="$Title.XML" class="$LinkingMode levelb"><span><em>$MenuTitle.XML</em></span></a></li>
										<% end_if %>
									<% end_control %>
								</ul>
							</li>
						</ul>
			 		 <% end_if %>
				<% end_if %> 
			</li> 
  			<% end_control %>
  		</ul>
		<div class="clear"></div>
	</div>
	<div class="sidebarBottom"></div>
</div>

So could someone help me? What have i to change in Sidebar.ss so that it works?

Greetings,
Tawny