i have a side navigation that is based on a certain documenttype on my site but whenever i click (navigate to) one of the links in the navigation, the navigation disappears. Below is my xslt code.
When clicking a link in the navigation it would appear you are going down a level within the site tree ($currentPage/*)
So when your page loads the navigation is looking for sub pages below it.
Are you wanting the navigation to display a fixed set of links when you are within a section of your site ?
If so your xslt should be changed to soemthing along the lines of
$currentPage/ancestor-or-self[@IsDoc and level() = 2]/*[name() = $documentTypeAlias2 and string(umbracoNaviHide) != '1']
The above is off the top of my (bald) head so is hopefully correct. The level number will be determined by the structure of yuor site and what level you are wanting displayed, so '2' may not be correct.
I've just realized that what i've been trying to do wont work. This is the structure of my site.
When i am on the home page (lvl 1 i think) i want a side navi to show the three pages at the bottom. They are of the doc type "startPara". Whenever i navigate to one of these pages, the navigation still has to show these pages.
Whenever i navigate to e.g. "eSourcing" (this is a different doctype) the sidenavigation has to change and show the subpages, in this case "content" and "content II". Again if i navigate to "content" or "content II" i still want these pages to be showned in the sidenavigation.
How do i acomplice this?
If i navigate to "Welcome". What level is this if home page is lvl 1?
Ok, i have tried a different approach. As you can see from the below code i am now trying to check for documenttypes to determine where to start to generate the navigation, but since im not very good at xslt it doesn't work.
Here is what i want it to do:
situation one: Display all nodes of the type "startPara" in navigation when im on the /home-page.apsx. This works=:)
situation two: When navigated to one of the pages of the startPara documenttype, go up one level and display all nodes in navigation of the type startPara. This doesn't work. The navigation disappears.
situation three: When i have navigated to a page of the documenttype "modules" (these are displayed in another navigation) i want the navigation to show all subpages to this Module node of the documenttype "paragraphs" This doesnt work either.
situation four: When navigated to a subpage of the "paragraph" type i still want the navigation to display the navigation from situation three.
navigation disappears on subpage
i have a side navigation that is based on a certain documenttype on my site but whenever i click (navigate to) one of the links in the navigation, the navigation disappears. Below is my xslt code.
I expect it to remain visible because i use documenttypes and not levels. Why does it disappear?
Hi Jan
When clicking a link in the navigation it would appear you are going down a level within the site tree ($currentPage/*)
So when your page loads the navigation is looking for sub pages below it.
Are you wanting the navigation to display a fixed set of links when you are within a section of your site ?
If so your xslt should be changed to soemthing along the lines of
$currentPage/ancestor-or-self[@IsDoc and level() = 2]/*[name() = $documentTypeAlias2 and string(umbracoNaviHide) != '1']
The above is off the top of my (bald) head so is hopefully correct. The level number will be determined by the structure of yuor site and what level you are wanting displayed, so '2' may not be correct.
Hope this helps.
Nigel
Well, what i want it to do is to look for the specific documenttype on the same level or levels above it.
I've just realized that what i've been trying to do wont work. This is the structure of my site.
When i am on the home page (lvl 1 i think) i want a side navi to show the three pages at the bottom. They are of the doc type "startPara". Whenever i navigate to one of these pages, the navigation still has to show these pages.
Whenever i navigate to e.g. "eSourcing" (this is a different doctype) the sidenavigation has to change and show the subpages, in this case "content" and "content II". Again if i navigate to "content" or "content II" i still want these pages to be showned in the sidenavigation.
How do i acomplice this?
If i navigate to "Welcome". What level is this if home page is lvl 1?
I have been looking at this http://our.umbraco.org/wiki/reference/xslt/xpath-axes-and-their-shortcuts
and from what i can see here it is impossible to go up one level at get all the nodes on that lvl.
Please tell this isn't so.
Ok, i have tried a different approach. As you can see from the below code i am now trying to check for documenttypes to determine where to start to generate the navigation, but since im not very good at xslt it doesn't work.
Here is what i want it to do:
situation one: Display all nodes of the type "startPara" in navigation when im on the /home-page.apsx. This works=:)
situation two: When navigated to one of the pages of the startPara documenttype, go up one level and display all nodes in navigation of the type startPara. This doesn't work. The navigation disappears.
situation three: When i have navigated to a page of the documenttype "modules" (these are displayed in another navigation) i want the navigation to show all subpages to this Module node of the documenttype "paragraphs" This doesnt work either.
situation four: When navigated to a subpage of the "paragraph" type i still want the navigation to display the navigation from situation three.
(hmm, this is strange. It isnt possible to format my text as "code" anymore)
Im pretty lost at the moment. I hope someone is able to help.
is working on a reply...