"If both objects to be compared are node-sets, then the comparison will be true if and only if there is a node in the first node-set and a node in the second node-set such that the result of performing the comparison on the string-values of the two nodes is true."
Great help thanks both, Fuji your code generates this
This is almost exactly achieving the example I posted above from the designer apart from Test 2 is also appearing indented when it should be inline with Test.
One other thing I would like is to have a '-' appear before the start of any sub nodes, where should this go?
Unfortunately the "-" at the moment are appearing on every node instead of just any sub nodes (as it was in my original XSLT) Also if you could advise on the Test 2 indention inline with Test on the post above that would be great
However, probably it would be a purer solution to decorate menu items with '-' by CSS, especially taking that your already assing 'levelN' classes to them.
Big apologies, i've just realised why, some of the nodes are of document tpyes that havent got NaviHide set up yet. Just ran a test by hiding a page where it is set up and it works fine. Clocking off for the night now.
Will try tomorrow again by setting NaviHide on the other document types and hopefully I will report good news.
Massive thank you for your efforts, much appreciated
Fuji, after working again on the navigation this morning and enabling NaviHide on the pages that should be hidden, the navigation still wasnt achiving what I hoped it would with all sub menu's (that had naviHide as false) still appearing.
I've since made amends to how the navigation will work, I have a top menu bar anyway, with this one being a side navigation i've changed the level to '2' as users will use the top navigation bar for main navigation with this one simply displaying the nodes contained underneath the top level.
This is a screen shot of what I now currently have
<!-- Input the documenttype you want here --> <!-- Typically '1' for topnavigtaion and '2' for 2nd level --> <!-- Use div elements around this macro combined with css --> <!-- for styling the navigation --> <xsl:variable name="level" select="2"/>
<xsl:template match="/"> <xsl:apply-templates select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']"/> </xsl:template> <xsl:template match="*">
On my image above, i am currently on the 'Underneath about page' the styling on this item and its parent is correct.
However what is incorrect is that the links found 'Underneath about page' -Success,Facilties,Virtual Tour should be positioned in the same place as where the About link is as (the far left) as Success,Facilties,Virtual Tour pages are a level up from the 'Underneath about page'.
Hoping this is easy to solve, thanks for your massive help so far
Hi Fuji, no still havent found a solution. As you can see in my last post, all I require is for the indent to be correct for same level nodes etc. If you could help me out that would be great
Menu navigation help
I currently have the following menu on my website
This is my XSLT for the above
The web designer however I had to design templates for me, designed the below which I hope to implement
Which was made possible through the following HTML
What I'm really struggling to implement is where I should put the element
in my XSLT
Any guidance would be much appreciated
Hey Matthew, you could do something like
hope this helps
Since (http://www.w3.org/TR/xpath/#booleans)
the following snipped should work:
Great help thanks both, Fuji your code generates this
This is almost exactly achieving the example I posted above from the designer apart from Test 2 is also appearing indented when it should be inline with Test.
One other thing I would like is to have a '-' appear before the start of any sub nodes, where should this go?
Rodion - have included your code, thanks
Good if you got it working, Looks like you already added " - " in your previous post..
Unfortunately the "-" at the moment are appearing on every node instead of just any sub nodes (as it was in my original XSLT) Also if you could advise on the Test 2 indention inline with Test on the post above that would be great
Can you try changing your XLST to something like this?
I havent tested it but it should get you working. You are getting the " - " since you are calling the same template on top
I suppose you can add <xsl:if ... for your '-' based on level:
However, probably it would be a purer solution to decorate menu items with '-' by CSS, especially taking that your already assing 'levelN' classes to them.
Latest update using your code
In an upshot the "-" are only appearing now on sub nodes but some how the NavHide values are not getting picked up, its seems close!
Matthew my mistake change this
to this
Unfortunately that hasnt made a difference
my current XSLT is:-
The current navigation can be viewed at http://web3.ystrad-mynach.ac.uk/the-college
I'm sure it is really close,
matthew from the link you posted - Test - Test 2 should be underneath - Test instead of having both on the same line right?
Just updated with the code above and voila..... the '-' is now appearing correctly although...... UmbracoNaviHide is still not kicking in correctly
Plus all subnodes from underneath other nodes are now appearing http://web3.ystrad-mynach.ac.uk/the-college/test/
Am not sure why this not not firing the UmbracoNaviHide here. Instead of
*[@isDoc][not(umbracoNaviHide = 1)]
change it to
[@isDoc and string(umbracoNaviHide) != '1']
Big apologies, i've just realised why, some of the nodes are of document tpyes that havent got NaviHide set up yet. Just ran a test by hiding a page where it is set up and it works fine. Clocking off for the night now.
Will try tomorrow again by setting NaviHide on the other document types and hopefully I will report good news.
Massive thank you for your efforts, much appreciated
No worries....
Fuji, after working again on the navigation this morning and enabling NaviHide on the pages that should be hidden, the navigation still wasnt achiving what I hoped it would with all sub menu's (that had naviHide as false) still appearing.
I've since made amends to how the navigation will work, I have a top menu bar anyway, with this one being a side navigation i've changed the level to '2' as users will use the top navigation bar for main navigation with this one simply displaying the nodes contained underneath the top level.
This is a screen shot of what I now currently have
With my XSLT as:-
On my image above, i am currently on the 'Underneath about page' the styling on this item and its parent is correct.
However what is incorrect is that the links found 'Underneath about page' -Success,Facilties,Virtual Tour should be positioned in the same place as where the About link is as (the far left) as Success,Facilties,Virtual Tour pages are a level up from the 'Underneath about page'.
Hoping this is easy to solve, thanks for your massive help so far
Hey Matthew,
Sorry for late reply, have you been able solved the navigation?..
Hi Fuji, no still havent found a solution. As you can see in my last post, all I require is for the indent to be correct for same level nodes etc. If you could help me out that would be great
is working on a reply...