Jump to:

23452 Posts in 18901 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Sidebar: only title when subpage or widget?

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

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

Page: 1
Go to End
Author Topic: 903 Views
  • raamklaza
    Avatar
    Community Member
    182 Posts

    Sidebar: only title when subpage or widget? Link to this post

    Hello!

    My sidebar show a box with the title of the page.

    I want only to show this when there are subpages or a widget. How do i do this?

    I tried a lot but i can't make it work.

    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="Ga naar de $Title.XML pagina" class="$LinkingMode levela"><span><em>$MenuTitle</em></span></a>
               <% else %>
                    <li><a href="$Link" title="Ga naar de $Title.XML pagina" class="$LinkingMode levela"><span><em>$MenuTitle</em></span></a>
                <% end_if %>   
              
                 <% if LinkOrSection = section %>
                    <% if Children %>
                      <ul class="sub">
                         <li>
                             <ul>
                                <span class="roundWhite">
                                <% control Children %>
                                    <li><a href="$Link" title="Ga naar de $Title.XML pagina" class="$LinkingMode levelb"><span><em>$MenuTitle.LimitCharacters(22)</em></span></a></li>
                                <% end_control %>
                                </span>
                              </ul>
                           </li>
                       </ul>
                     <% end_if %>
                <% end_if %>
             </li>
             <% end_control %>
          </ul>
          <div class="clear"></div>   
       </div>   
       $Sidebar
             
    </div>

  • raamklaza
    Avatar
    Community Member
    182 Posts

    Re: Sidebar: only title when subpage or widget? Link to this post

    Anyone?

    How can i tackle this, because i really don't want this box everywhere. On somepages it f*ck up my lay-out

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