Immediate Preceding & Following Siblings Hidden in Menu
Hi,
I have an interesting challenge wherein I want to show Prev and Next Links along a level but ONLY where umbracoNaviHide is false. The reason I'm having trouble is that in order to get the immediate one I have to specify the first ([1]), but the fact is that the preceding or following siblings may or may not have umbracoNaviHide set. So, the result is that my links only show IF the that particular sibling IS shown in the menu. Here is my faulty code:
How can I code it so that it only "looks for" the IMMEDIATE NEXT or PREVIOUS sibling which *IS* shown in the menu? In other words, if we're talking about Next, then if the immediate next one is not shown in the menu, then go to the next one and so on until we find one that's umbracoNaviHide != 1. Otherwise print nothing.
Nice to see you found a way to do it - just because I'm a little pedantic with XSLT, here's how you can make the selection directly in the XPath, which is what you really wanted to know, I'm sure :-)
You are always the bomb -- you've opened my eyes to WAY more code-efficient code solutions on numerous occasions. You're the best XSLT expert of whom I know, and I am sure I'm not alone. Seriously. And best part of it, you always respond. You're an OSH. An Open Source Hero. Everyone knows it.
As usual, your code is shorter again. I don't think you've ever typed <xsl:for-each in your natural life. Genius. Don't need a loop because we only need one node. Done. Using your code.
Immediate Preceding & Following Siblings Hidden in Menu
Hi,
I have an interesting challenge wherein I want to show Prev and Next Links along a level but ONLY where umbracoNaviHide is false. The reason I'm having trouble is that in order to get the immediate one I have to specify the first ([1]), but the fact is that the preceding or following siblings may or may not have umbracoNaviHide set. So, the result is that my links only show IF the that particular sibling IS shown in the menu. Here is my faulty code:
How can I code it so that it only "looks for" the IMMEDIATE NEXT or PREVIOUS sibling which *IS* shown in the menu? In other words, if we're talking about Next, then if the immediate next one is not shown in the menu, then go to the next one and so on until we find one that's umbracoNaviHide != 1. Otherwise print nothing.
Is that clear?
Thanks in advance,
Garrett
Hey, I got this working so I'm posting the solution:
Thanks for all who took a look at it.
//Garrett
Hi Garrett,
Nice to see you found a way to do it - just because I'm a little pedantic with XSLT, here's how you can make the selection directly in the XPath, which is what you really wanted to know, I'm sure :-)
/Chriztian
Pedantic my a**, Chriztian!
You are always the bomb -- you've opened my eyes to WAY more code-efficient code solutions on numerous occasions. You're the best XSLT expert of whom I know, and I am sure I'm not alone. Seriously. And best part of it, you always respond. You're an OSH. An Open Source Hero. Everyone knows it.
As usual, your code is shorter again. I don't think you've ever typed <xsl:for-each in your natural life. Genius. Don't need a loop because we only need one node. Done. Using your code.
Thanks as always C,
Garrett
Hi Garrett
A wicked response by Chriztian - maybe mark his response as the solution - I have high fived him due to the excellent answer....
Hehe - awesome thing to wake up to - that, and Jim Dalrymple's "Rabid Beaver" laugh on the "Amplified" podcast. My day is made, that's for sure :-)
/Chriztian
is working on a reply...