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.

General Questions

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

Widgets only show up one page with submenu.


Go to End
Reply

14 Posts   2112 Views

Avatar
raamklaza

25 June 2009 at 10:56am Community Member, 182 Posts

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>

   
   
   

Avatar
TotalNet

25 June 2009 at 11:00am Community Member, 181 Posts

That should work.

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

Avatar
raamklaza

27 June 2009 at 6:01am Community Member, 182 Posts

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.

Avatar
raamklaza

28 June 2009 at 3:11am Community Member, 182 Posts

Anyone?

Avatar
raamklaza

6 July 2009 at 9:44pm Community Member, 182 Posts

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

Can someone shine some light on this

Avatar
Willr

6 July 2009 at 10:13pm Forum Moderator, 5511 Posts

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

Avatar
raamklaza

7 July 2009 at 3:43am Community Member, 182 Posts

Oke that worked.

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

Where should i change that?

Avatar
raamklaza

8 July 2009 at 6:14am (Last edited: 8 July 2009 10:50am), Community Member, 182 Posts

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>

Go to Top