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.

We've moved the forum!

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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How to get current parent page from sublevel 2 ?


Go to End


7 Posts   3185 Views

Avatar
jQuery.in.th

Community Member, 7 Posts

21 August 2009 at 5:42pm

I have page 2 level

Example :

Home Level1
|
- Subcontent Level 2
- Subcontent Level 2

I want "Home Level 1" active link after I clicked "Subcontent Level 2"...
Now it active just menu "Subcontent Level 2".

Please help me. :)

Avatar
bummzack

Community Member, 904 Posts

21 August 2009 at 7:12pm

You can style your menus using the classes provided by the $LinkingMode template control (read the docs).

If you're using a theme, chances are high that the menu already uses the $LinkingMode class. All that is left to do in that case is to add the appropriate styles for .section

Avatar
jQuery.in.th

Community Member, 7 Posts

21 August 2009 at 7:55pm

Edited: 21/08/2009 8:03pm

Thank you for reply. :)

Please see images below.


Avatar
jQuery.in.th

Community Member, 7 Posts

21 August 2009 at 8:04pm

Edited: 21/08/2009 8:07pm

Avatar
bummzack

Community Member, 904 Posts

21 August 2009 at 9:29pm

Yes, I understood that from your first post and I provided you with the solution as well.
When you're in "sub menu", the Overview menu-item most likely gets the section css class. All that is left to do for you is add the proper styles for .section in your css file.

Avatar
jQuery.in.th

Community Member, 7 Posts

21 August 2009 at 9:30pm

:) Oh Cool it very easy. Thank you for your guide.

<div style="width:120px">
    <ul>
         <% control Menu(2) %>      
              <li id="menu"> 
                        <a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode<% if FirstLast %> $FirstLast<% end_if %>"><span>$MenuTitle.XML</span></a> 
              </li>
         <% end_control %>
     </ul>
 </div>

Avatar
jQuery.in.th

Community Member, 7 Posts

21 August 2009 at 9:32pm

Thank you Mr. banal very very so much.
I am new programming for SilverStripe :)

I love SilverStripe.