3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1141 Views |
-
Hide Menu if only one page

11 July 2010 at 10:40pm
How can I hide the menu if there is only one page.
It is currently set to only show Menu2 if it is currently on the Image Gallery page.
But there is currently only one page and I want the menu to be hidden until the second album / page is added.Page.ss
<% if LinkOrCurrent = current %>
<% if is_a(ImageGalleryPage) %><div id="Sidebar" class="typography">
<div class="sidebarBox">
<ul id="Menu2">
<% control Albums %>
<li class="$LinkingMode"><a class="$LinkingMode" href="$Link" title="$AlbumName" alt="$AlbumName">$AlbumName</a></li>
<% end_control %>
</ul>
<div class="clear"></div>
</div>
</div><% end_if %><% end_if %> -
Re: Hide Menu if only one page

13 July 2010 at 7:20pm
For checking if there are multiple Albums you can use:
<% if SingleAlbumView %>
<% else %><% end_if %>
-
Re: Hide Menu if only one page

14 July 2010 at 12:20am
Perfect thanks!!!
For any one else:
<% if LinkOrCurrent = current %>
<% if is_a(ImageGalleryPage) %><% if SingleAlbumView %><% else %>
<div id="Sidebar" class="typography">
<div class="sidebarBox">
<ul id="Menu2">
<% control Albums %>
<li class="$LinkingMode"><a class="$LinkingMode" href="$Link" title="$AlbumName" alt="$AlbumName">$AlbumName</a></li>
<% end_control %>
</ul>
<div class="clear"></div>
</div>
</div><% end_if %><% end_if %><% end_if %> -
Re: Hide Menu if only one page

6 January 2012 at 10:30pm
Hi guys is there a way I can hide the menu on a particular page so that it can only be accessed via the link only please.
e.g. if the link to that page is "www.cm-research.com/UKsurvey" I want it so that the age can only be accessed by the link but can not be seen on the menu.
I have managed to get the particular page to appear on the menu, but I can't seem to figure out how to get the menu of the particular page.
any help would be greatly appreciated.
I am new to Silverstripe so please bare with me.
Many thanks in advance
-
Re: Hide Menu if only one page

7 January 2012 at 2:16am
Hi CMRwebadmin,
Welcome to the Forums!
How about goign to the page in question, the Behaviour tab and then unchecking "Show in menus?"
| 1141 Views | ||
|
Page:
1
|
Go to Top |




