Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Open Redirector Page in new Tab

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

Page: 1
Go to End
Author Topic: 1553 Views
  • Tawny
    Avatar
    Community Member
    1 Post

    Open Redirector Page in new Tab Link to this post

    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

    1553 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.