Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Hardy Wang 91 posts 112 karma points
    Jul 08, 2011 @ 15:26
    Hardy Wang
    0

    MSDN Style Navigation Menu

    Hi all,

    I am new to Umbraco and currently evaluating the tool to decide if my company is going to migrate some of the content from other platform to Umbraco.

    One feature from current solution is that the page has hierarchy structure (I can see Umbraco also provides the same concept), and based on page and structure a left side navigation menu is generated automatically (I have seen some samples to use XSLT to achieve it in Umbraco as well).

    With the samples I can find so far the whole structure is expanded. What we prefer is that, for example we have following page structure:

    - Level 1 - Page 1
    - - Level 2 - Page 1.A
    - - Level 2 - Page 1.B
    - Level 1 - Page 2
    - - Level 2 - Page 2.A
    - - Level 2 - Page 2.B
    - Level 1 - Page 3
    - - Level 2 - Page 3.A
    - - - Level 3 - Page 3.A.I
    - - - Level 3 - Page 3.A.II
    - - Level 2 - Page 3.B
    - - - Level 3 - Page 3.B.I
    - - - Level 3 - Page 3.B.II

    When sombody visits some level of page (e.g. Page 3) we need to display menu like:

    - Level 1 - Page 1
    - Level 1 - Page 2
    - Level 1 - Page 3
    - - Level 2 - Page 3.A
    - - Level 2 - Page 3.B

    General speaking, we want to expand menu one level down on the currently visited page only, the rest sub-levels should be collapsed until it is selected and viewed.

    When somebody is viewing Page 2, the navigation menu should look like:

    - Level 1 - Page 1
    - Level 1 - Page 2
    - - Level 2 - Page 2.A
    - - Level 2 - Page 2.B
    - Level 1 - Page 3

    Any idea, is is possible to achieve?

    Thanks

    Hardy

  • Rich Green 2246 posts 4008 karma points
    Jul 08, 2011 @ 15:50
    Rich Green
    0

    Hey Hardy,

    Welcome to the forum.

    Yes, you certainly can achieve this in Umbraco, xslt will be a good for this, or you can use Razor if you prefer.

    Rich

  • Hardy Wang 91 posts 112 karma points
    Jul 08, 2011 @ 16:24
    Hardy Wang
    0

    Hi Rich,

    Thanks for the quick response.

    Do you have further reference I can read? I think and think that XSLT will be able to pull a list of page name from hierachy structure (of course I can apply some filter and so on), but the list generated from XSLT will contain everything I need to display. I believe I need to fit this navigation tree into master template and all page will use it, the template itself has no knowledge of what is the current page, and how can I collapse unwanted nodes?

    I will also look into Razor.

    Thanks for further clarification.

    Hardy

Please Sign in or register to post replies

Write your reply to:

Draft