Copied to clipboard

Flag this post as spam?

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


  • robert coyle 14 posts 34 karma points
    Aug 08, 2010 @ 21:58
    robert coyle
    0

    Sub navigations on different page

    Hi There Folks,
    Im a newbie just over from Joomla and finding it tough :) Ive been reading documentation and forums for two days and finally decided to hit the forum with a question. Its a question about now to get navigation/menus working the way I want. 

    I current have the Runway Top Navigation installed and have figured out how create navigations, add them to my template, and set what menu item they display using xpath-axes-and-their-shortcuts. Good for me :) However im now stumped by something. Here goes:

    Question) How do I put a sub menu on all pages I want an not just the parent?
    Ive created my structure using the advice given so it looks like this:
    CONTENT
    -Home
    --Sub 1
    ---Subsub1
    ---Subsub2
    --Sub 2

    My node(page) Sub1 displays a nice sub menu becuase I have this line in the menu code
    <xsl:if test="$currentPage/descendant-or-self::node/@id = current()/@id">

    However, what if I want the same submenu (Subsub1, Subsub2) that appears on Sub 1 to appear on Sub 2 or on all/some subpages?? I really think im missing something in all this. Is there some way of telling my nav macro to look at a set of nodes by number rather than parent/child etc? Is that the solution? If so it would be great if someone could spell out for me where I need to make the code change with an example. Unfortunately im one of those people who finds looking at code like looking into a bush :) Mysterious.

    Thanks community :)

     

     

     

     

     

     

     

     

  • Bogdan 250 posts 427 karma points
    Aug 09, 2010 @ 12:28
    Bogdan
    0

    You can maybe check this out http://our.umbraco.org/projects/website-utilities/cogworks-flexible-navigation . You don't have to install the package, just open the zip, it contains an xslt file that you can research to achieve what you want, or maybe just use it as it is if it suits your needs. I'm not sure I understand though, do you want Subsub1 and Subsub2 to appear under Sub 2 even though they are only under Sub 1? Or does Sub 2 also have its own Subsub and want that to be visible even when you're in the Sub 1 branch?

  • robert coyle 14 posts 34 karma points
    Aug 09, 2010 @ 13:44
    robert coyle
    0


    Thanks for your reply! Scenario 1 is what im looking for ... as you say "Subsub1 and Subsub2 to appear under Sub 2 even though they are only under Sub 1?". Although this scenarios is just a framwork to ask about the flexibility of navigations.

    Heres a real world situation. Iets say on the ABOUT US and CONTACT  page of my site only i wanted an extra left navigation (extra because there might already be a left navigation that just lists child nodes). The extra navigation shows a few links to whatever! Would I need to completely hardcode this extra navigation? If not where would its nodes sit (node = page that correlates to link)  and how would the navigation reference them?

    At the moment, from what I can see, you can only make sub navigations showing links to page/nodes on that particuar branch of the page tree (content structure). Maybe im missing something. Can a navigation be created to target a nodes and its decendants by node number maybe?

    (I have added an image that I hope shows what im asking)

    Thanks a lot bfi

     

  • Bogdan 250 posts 427 karma points
    Aug 09, 2010 @ 15:48
    Bogdan
    0

    You don't have to hardcode the extra links you want in the submenu, you can use something like http://our.umbraco.org/projects/backoffice-extensions/tree-multi-picker (I never used this package, I just assume right now that it may be good for you). Then in your loop where you generate the submenu, add another loop that goes through the extra selected nodes and add them. About your question about the navigation targetting the node id, think about it this way: the xslt you write works on the umbraco cache; the cache is in the umbraco.config file, in the data folder, you can look around in it to make an idea of how to achieve what you want, using the functions xslt provides, for loops, for selecting and filtering branches in an xml file. So yes, you can use the node id when selecting data. You can use the built-in content picker data type to select a node from another node, let's say in your 'Articles' page and select another page from the website and name this property 'extraPage'. Then in the loop, when getting to the 'Articles' page, this 'extraPage' property's value will be the id of the node you selected - for example you can select FAQ. I think (again, I may be wrong) that the tree multi picker does the same thing as the built-in picker, except it lets you select multiple nodes - this way you can select FAQ, and Favourite Links, and any nodes you want. And so on, the possibilities with umbraco are endless, because you can create whatever custom properties you want for your nodes, and you can read/parse them in so many ways. After you add a custom property, like 'extraPage', you can open umbraco.config again, to see where it is in the xml structure.

     

    Hope this helps!

  • Bogdan 250 posts 427 karma points
    Aug 09, 2010 @ 15:56
    Bogdan
    0

    Another thing you can do is add to the FAQ, Favourite Links and any page you want as extra link in the submenu on the right a true/false property, and call it let's say 'isExtraLink' and when you generate the navigation on the right also select all the nodes that have that property true. You can also use a Master document type for all your document types, and create the property here, this way the properties belonging to it will be inherited so you won't have to create them in every document type. Then just go to the pages you want as extra links on the right and change it to true (or Yes).

  • robert coyle 14 posts 34 karma points
    Aug 11, 2010 @ 02:19
    robert coyle
    0

    Hi BFI,

    Wow that worked perfectly. I had been scratching my heading trying to figure out MTTUltimate nav but the link you sent to this other option is much better documented. our.umbraco.org/.../tree-multi-picker ... and I have gotten it to recreate the examples I gave in my last reply.The PDF/Documentation in this package give simple examples of the code that needs to be added to the template. Great.

    As for your second post, ill have to try this out also.

    I really appreciate you help on this. I think it would be great if the Umbraco folks could write a book just on navigation/menus so people can see how these well know ideas apply to esoteric ideas like nodes and doc types.

    Karma bubble coming your way. Robert

     

Please Sign in or register to post replies

Write your reply to:

Draft