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

Sidebar: only title when subpage or widget?


Go to End
Reply


2 Posts   1036 Views

Avatar
raamklaza

Community Member, 182 Posts

15 July 2009 at 7:01am

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>
 

Avatar
raamklaza

Community Member, 182 Posts

16 July 2009 at 1:56am

Anyone?

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