Jump to:

3393 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » Limiting the display of grandparent/ parents pages in the side menu

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

Page: 1
Go to End
Author Topic: 795 Views
  • Tama
    Avatar
    Community Member
    119 Posts

    Limiting the display of grandparent/ parents pages in the side menu Link to this post

    Hopefully some of you have already tried this method of navigation so I thought I'd put a question up here and save myself from re-inventing the wheel.

    Using nested numbers the default menu structure in the left sidebar looks like this if the user is viewing the page "3.3. Page Title":

    1. Page Title
    2. Page Title
    3. Page Title
    3.1. Page Title
    3.2. Page Title
    3.3. Page Title
    3.4. Page Title
    4. Page Title

    This can be extended out to more than levels:
    1. Page Title
    2. Page Title
    3. Page Title
    3.1. Page Title
    3.2. Page Title
    3.3. Page Title
    3.3.1. Page Title
    3.3.2. Page Title
    3.3.3. Page Title
    3.3.4. Page Title
    3.4. Page Title
    4. Page Title

    The difficulty with this method is if you have a lot of options (we tend to have 8 children to each parent page) and a deep website structure (5 levels) the vertical size of the menu becomes quite baffling.

    The menu display system I'd like to use follows:

    3. Page Title
    3.3. Page Title
    3.3.1. Page Title
    3.3.2. Page Title
    3.3.3. Page Title
    3.3.4. Page Title

    So the menu only shows the following:

    • The page
    • The page's siblings
    • The page's parent
    • The page's grandparent
    • The page's great-grandparent
    • etc.

    In essence this is similar to breadcrumbs except the page siblings are shown too.

    Has anyone take this approach before? Any code examples would be greatly appreciated.

    Cheers
    Tama

    795 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.