3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 844 Views |
-
Need help with subnav

16 April 2011 at 1:40am
Hi all I want to be able to make the sub nave of the fist tab available on every page without having to replicate pages on every root section.
link - http://bizmohost.com/moish/bw/medical-team/
Your help would be much appreciated
Regards
Robbie
-
Re: Need help with subnav

16 April 2011 at 12:02pm Last edited: 16 April 2011 12:04pm
Hi Robbie,
If you want to send people to the pages in the first section when they click the links you could generate links to the original pages in the templates using similar code to what is producing your subnav on each page, but just change 'Menu(2)' to 'Page(Your-page-URL)'. So for instance:
<% control Page(Home) %>
<% if Children %>
<li><a href="$Link" title="Go to the "{$Title.XML}" page" class="$LinkingMode levela parent"><span>$MenuTitle.XML</span></a>
<% else %>
<li><a href="$Link" title="Go to the "{$Title.XML}" page" class="$LinkingMode levela"><span>$MenuTitle.XML</span></a>
<% end_if %>
<% if LinkOrSection = section %>
<% if Children %>
<ul class="sub">
<% control Children %>
<li><a href="$Link" title="Go to the "{$Title.XML}" page" class="$LinkingMode levelb"><span>$MenuTitle.XML</span></a></li>
<% end_control %>
</ul>
<% end_if %>
<% end_if %>
</li>
<% end_control %>http://doc.silverstripe.org/sapphire/en/reference/built-in-page-controls?s=page%252520controls
or, you could create virtual pages in each section which point back to the pages in the first tab so that they automatically display whatever is on those pages, meaning you don't have to update multiple identical pages. This will keep the user in the relevant section unlike a Redirector page or the method above which would send them to the page in the first section.
| 844 Views | ||
|
Page:
1
|
Go to Top |


