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
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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
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.