How can i get to display a SubNavigation depending on the Parent Node Position. What i need to do is be able to start my Sub Nav on the same top position as the Parent.
I try something like that but am messing up my xslt here
<xsl:variable name="level" select="4"/> <xsl:variable name="nodes" select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']" /> <xsl:template match="/"> <!-- The fun starts here --> <xsl:for-each select="$nodes"> <xsl:choose> <xsl:when test="position ()= 2"> <xsl:call-template name="firstNode" /> </xsl:when> <xsl:otherwise> <xsl:call-template name="secondNode" /> </xsl:otherwise> </xsl:choose> </xsl:for-each>
Could you show a website example of the effect you're trying to achieve? Think it's easier to grasp the essence of the question if there is a visual desired end result to look at.
So what needs to be done here is when i am on Product Cat 1 its subContent displays in a <ul> with a top position and if am on Product 2 it displays with a different top position .
Sorry for my late reply - did you manage to fix this?
The way I understand your issue is that it's about displaying the nodes on the website with CSS, right? It's not neccesary a matter of the code structure, is it?
Sounds like you need to render a nested list of elements and then have elements of a certain level displayed in a certain way?
Yes in fact i needed to check if parent has child nodes and if its the first parent node does display the child node with a top position and if not with another position.
Well instead of XSLT i did it in Razor. Here is how i got it solved out.
Positioning SubNav depending on the Parent Node
Hi,
How can i get to display a SubNavigation depending on the Parent Node Position. What i need to do is be able to start my Sub Nav on the same top position as the Parent.
I try something like that but am messing up my xslt here
Hi Fuji
Could you show a website example of the effect you're trying to achieve? Think it's easier to grasp the essence of the question if there is a visual desired end result to look at.
/Jan
Hi Jan,
Well very simple my content tree section looks like this
Content
-Home
-- Products
--- Product Cat 1
--Item 1
--Item 2
--Item 3
--- Product Cat 2
--Item 1
--Item 2
--- Product Cat 3
--- Donwloads
--- Contacts
--- etc
So what needs to be done here is when i am on Product Cat 1 its subContent displays in a <ul> with a top position and if am on Product 2 it displays with a different top position .
//fuji
In other words Sub Navigation will display depending on the Parent Node Position.
If Parent Node has a Position () = 1 the Sub Navi will have a certaint top position and if Position() = 2 a different one.
Hi Fuji
Sorry for my late reply - did you manage to fix this?
The way I understand your issue is that it's about displaying the nodes on the website with CSS, right? It's not neccesary a matter of the code structure, is it?
Sounds like you need to render a nested list of elements and then have elements of a certain level displayed in a certain way?
/Jan
Hi Jan,
Yes in fact i needed to check if parent has child nodes and if its the first parent node does display the child node with a top position and if not with another position.
Well instead of XSLT i did it in Razor. Here is how i got it solved out.
//fuji
is working on a reply...