Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Widgets only show up one page with submenu.

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 2
Go to End
Author Topic: 2094 Views
  • raamklaza
    Avatar
    Community Member
    182 Posts

    Widgets only show up one page with submenu. Link to this post

    Widgets only show up one page with submenu.

    In the past i was tolled to delete the if Menu(2)....

    But this tric doesn't help anymore....

    Can someone help me out?

    <div class="typography">
       <% if Menu(2) %>
          <% include SideBar %>
          <div id="Content">
       <% end_if %>
             
       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
          <h2>$Title</h2>
       
          $Content
          $Form
          $PageComments
       
       <% if Menu(2) %>
          </div>
       <% end_if %>
    </div>

       
       
       

  • TotalNet
    Avatar
    Community Member
    181 Posts

    Re: Widgets only show up one page with submenu. Link to this post

    That should work.

    are you keeping <% include SideBar %> in there?

  • raamklaza
    Avatar
    Community Member
    182 Posts

    Re: Widgets only show up one page with submenu. Link to this post

    Yes i am keeping that in there.

    I tried this again: http://silverstripe.org/archive/show/224693#post224693

    I removed the first check on the \Layout\Page.ss page.

    Now i get this message:
    XML-parsefout: niet-overeenkomende tag. Verwacht: </div>.
    Locatie: http://localhost/1-Ontwikkeling/roufaida.nl/contact-us/
    Regelnummer 141, kolom 3:
    </body>
    --^

    I hope someone can help me out.

  • raamklaza
    Avatar
    Community Member
    182 Posts

    Re: Widgets only show up one page with submenu. Link to this post

    Anyone?

  • raamklaza
    Avatar
    Community Member
    182 Posts

    Re: Widgets only show up one page with submenu. Link to this post

    I really would like to see widgets if there isn't a submenu

    Can someone shine some light on this

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Widgets only show up one page with submenu. Link to this post

    If there is no submenu then <% if Menu(2) %> will fail. Just remove the if statement and it will always include the sidebar

  • raamklaza
    Avatar
    Community Member
    182 Posts

    Re: Widgets only show up one page with submenu. Link to this post

    Oke that worked.

    But now i always see a box on the left. (see http://www.roufaida.nl/ )

    Where should i change that?

  • raamklaza
    Avatar
    Community Member
    182 Posts

    Re: Widgets only show up one page with submenu. Link to this post

    This is my sidebarss and my page.ss.

    How can i make sure my Widgets are always visible?? And when there is no subpage it doesn't show anything from the sidebar????

    Help me please

    Page.ss
    <div class="typography">
       <% if Menu(2) %>
          <% include SideBar %>
          <div id="Content">
       <% end_if %>
             
       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
          <h2>$Title</h2>
       
          $Content
          
          <div id="ShareThis">
          <script type="text/javascript" src="http://w.sharethis.com/button/sharetbla bla script......</script>
          </div>
                
          $Form
          $PageComments
          
       <% if Menu(2) %>
          </div>
       <% end_if %>      

       
    </div>

    Sidebar.ss
    <div id="Sidebar" class="typography">
       <div class="sidebarBox">       
          <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>

    2094 Views
Page: 1 2
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.