Hopefully I can get some help with this... We picked up a website that one of our vendors created and we need to change the footer navigation. The template that is in place now is this:
What the user does now is in every page, there is 2 check boxes that say Top or bottom navigation with an ID of pageNavigation. The problem is, the user can't control this dynamically, and they can't reorder it to however they want. I was wondering if anyone had any ideas about how to either allow them to choose the pages that are allowed to be in the footer, and be able to specify the order.
Not sure what you mean by they "can't control this dynamically"? Can't they just check the checkbox to say "show in footer nav"?
RE the ordering, it looks like it orders things in the natural order they appear, so technically you do have control over the sorting, you can just sort the nodes in the node tree, and they will appear in that order (This is generally a pretty normal way to achive this).
If you require them sorting by some other means, you could do an XSLT sort if you just need them alphabetically. If you need them in such an order that they differ between the main and footer nav, then yea, you are going to have to do a little more work. A simple way could be to just drop a "sortIndex" property onto all your templates, then do an XSLT sort on that, but it could get a little dificuilt to manage if you have a few nodes.
The rough idea being that you have two, one for header and one for footer, there would only be one of each of these in your whole site (probably on the home node or it a settings section)
You then use the id's selected in the tree picker to display the links in the footer, the order the user selected will remain in tack.
Many Thanks For the quick reply Matt... I get what your saying the one thing that I am running into is that we have different pages on our website, and sub pages under those. The problem is, is that there is a page on the second level navigation that we want to show in the footer. When we click the Show in footer nav, it doesn't show. i was playing around with the levels in the code changing them from 1 level to 2, but then that toally messes up the result.. Does that make any sense?
This is correct.. Matt's suggestion does work.. The other problem I am running into is with the different levels.. For instance, under an main heading navigation, there is a link that links to a quality page. I want just that second level to show in the footer navigation. The problem is with the levels in the code. I tried playing with the Maxlevel chaning it to 1, and the other levels changing it to 2. No matter, what I do, I cannot get the sub page to show in the footer. if i change the level to 2, I lose the main navigation and just get the second level navigation.. Does that make any sense?
Looking at the script, it seems like it can run in 2 modes.
If you set the level to 0, it should just return a list of links who are set to display in the footer as a flat list.
If you set the level to something greater than 0, then it'll create a tree type structure. If this is what structure you need, then you'll need to set level to be greater than or equal to the depth of the item you want to show, but will also need to see the ancesters of that item to also show in the footer (You can't show a child node, if it's parent isn't visible aswell).
Without knowing exactly what you are trying to output, it's a bit hard to say what you should do exactly, but I'd certainly have a play around this area.
If you want to replace that functionality completley with something with a bit more control, then I'd take a look at Rich's suggestion.
That is to be expected, as that is the maxLevel variable you are modifying, so no nodes exist at level 0, so won't display. The level variables looks to be defined as a macro paramater which get's passed in. Have you tried modiying that?
XSLT Navigation Footer
Hi There,
Hopefully I can get some help with this... We picked up a website that one of our vendors created and we need to change the footer navigation. The template that is in place now is this:
What the user does now is in every page, there is 2 check boxes that say Top or bottom navigation with an ID of pageNavigation. The problem is, the user can't control this dynamically, and they can't reorder it to however they want. I was wondering if anyone had any ideas about how to either allow them to choose the pages that are allowed to be in the footer, and be able to specify the order.
Any help would be greatly appreciated.. Thanks
Hey Vincent,
Not sure what you mean by they "can't control this dynamically"? Can't they just check the checkbox to say "show in footer nav"?
RE the ordering, it looks like it orders things in the natural order they appear, so technically you do have control over the sorting, you can just sort the nodes in the node tree, and they will appear in that order (This is generally a pretty normal way to achive this).
If you require them sorting by some other means, you could do an XSLT sort if you just need them alphabetically. If you need them in such an order that they differ between the main and footer nav, then yea, you are going to have to do a little more work. A simple way could be to just drop a "sortIndex" property onto all your templates, then do an XSLT sort on that, but it could get a little dificuilt to manage if you have a few nodes.
Many thanks
Matt
Hi Vincent,
You can order and pick content with the tree multipicker http://our.umbraco.org/projects/backoffice-extensions/tree-multi-picker
The rough idea being that you have two, one for header and one for footer, there would only be one of each of these in your whole site (probably on the home node or it a settings section)
You then use the id's selected in the tree picker to display the links in the footer, the order the user selected will remain in tack.
Rich
Many Thanks For the quick reply Matt... I get what your saying the one thing that I am running into is that we have different pages on our website, and sub pages under those. The problem is, is that there is a page on the second level navigation that we want to show in the footer. When we click the Show in footer nav, it doesn't show. i was playing around with the levels in the code changing them from 1 level to 2, but then that toally messes up the result.. Does that make any sense?
Didn't see Matt's reply before I posted.
I think there are two things going on, your main top navigation, and some links in the footer which the user can choose and order, is that correct?
I didn't have time to read through your code but as Matt rightly states navigation is usually presented in the order it lives in Umbraco.
I wouldn't use my suggestion of using the tree picker for your top nav (I misunderstood your post) but the for the footer it should work fine.
Rich
This is correct.. Matt's suggestion does work.. The other problem I am running into is with the different levels.. For instance, under an main heading navigation, there is a link that links to a quality page. I want just that second level to show in the footer navigation. The problem is with the levels in the code. I tried playing with the Maxlevel chaning it to 1, and the other levels changing it to 2. No matter, what I do, I cannot get the sub page to show in the footer. if i change the level to 2, I lose the main navigation and just get the second level navigation.. Does that make any sense?
Hey Vincent,
Looking at the script, it seems like it can run in 2 modes.
If you set the level to 0, it should just return a list of links who are set to display in the footer as a flat list.
If you set the level to something greater than 0, then it'll create a tree type structure. If this is what structure you need, then you'll need to set level to be greater than or equal to the depth of the item you want to show, but will also need to see the ancesters of that item to also show in the footer (You can't show a child node, if it's parent isn't visible aswell).
Without knowing exactly what you are trying to output, it's a bit hard to say what you should do exactly, but I'd certainly have a play around this area.
If you want to replace that functionality completley with something with a bit more control, then I'd take a look at Rich's suggestion.
Matt
Its acting a little funny. If I change this piece of code:
If I change that variable to a 2, i get the tree notion. If i change that to a 0 i get no navigation what so ever.
Hi Vincent,
That is to be expected, as that is the maxLevel variable you are modifying, so no nodes exist at level 0, so won't display. The level variables looks to be defined as a macro paramater which get's passed in. Have you tried modiying that?
Matt
Yes.. I have, no luck, if i am looking in the right place for it.
Thanks all for the help.. I was able to figure it out.. The piece of code that needed to be changed was
There was a 1 where the 2 was.. AS soon as that was changed it worked beautifully.. Hope this can help someone else.. Thanks again.
is working on a reply...