This works fine when I add a new page under "Home" & under "Case Studies".
My problem is that I want to add another navigation at the top of the page.
Where is best to place these pages? Would it be on the same level as "Home" or as a child. The isssue I came across when I added them on the same level as "Home" was that the main Nav disappeared.
Any help or a point in the direction of a tutorial would be great.
I have a few sites where I have several bits of navigation, for example links at the top right, main navigation and then footer navigation. I have found the best way to do this is to use the uComponents multinode picker.
On the Homepage doc type, I add a new property for each navigation that I want, each using the multinode picker data type. I then choose the pages that I want to appear in the navigation using those pickers. That way you can pull in content into the navigation from anywhere in the site! To use them, just create a macro for each one that uses the node IDs stored in the property to build the navigation.
You can do this in several ways. One way is the option that Tim suggested using some kind of multiple node picker. Another way could be to put a checkbox on your nodes that can be checked if the node should be vissible in the top. Either way I'd suggest that you create the nodes under you Home-node to keep all other navigation intact.
Just a small tip on your xslt. I think you can save some lines of code by changing your a-element to somethink like this:
Navigation Structure - Two Menus
Hi all,
Im newbie with umbraco & xslt and having some issues with templates & navigation.
It probably best to say what I want & then show what I've got.
I /have a navigation like this.
Content
>Home
>>Products
>>About Us
>>Case Studies
>>>Case Study One
>>>Case Study Two
With the following xsl.
<xsl:template match="/">
<!-- The fun starts here -->
<div class="tal-35" id="nav">
<ul>
<li class="navItem1"><a href="/">Home</a></li>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:if test="umbracoNaviHide != 1">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="class">
<xsl:text>nav</xsl:text>
<xsl:if test="position() = 1">
<xsl:text>Item2</xsl:text>
</xsl:if>
<xsl:if test="position() = 2">
<xsl:text>Item3</xsl:text>
</xsl:if>
<xsl:if test="position() = 3">
<xsl:text>Item4</xsl:text>
</xsl:if>
<xsl:if test="position() = 4">
<xsl:text>Item5</xsl:text>
</xsl:if>
<xsl:if test="position() = 5">
<xsl:text>Item6</xsl:text>
</xsl:if>
<xsl:if test="$currentPage/ancestor-or-self::*[@isDoc]/@id = @id">
<xsl:text> selected</xsl:text>
</xsl:if>
</xsl:attribute>
<xsl:value-of select="@nodeName" />
</a>
<xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1']) > 0">
<ul>
<xsl:for-each select="./* [@isDoc and string(umbracoNaviHide) != '1']">
<li><a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></li>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</xsl:if>
</xsl:for-each>
This works fine when I add a new page under "Home" & under "Case Studies".
My problem is that I want to add another navigation at the top of the page.
Where is best to place these pages? Would it be on the same level as "Home" or as a child.
The isssue I came across when I added them on the same level as "Home" was that the main Nav disappeared.
Any help or a point in the direction of a tutorial would be great.
Thanks
Martin
Hi Martin!
I have a few sites where I have several bits of navigation, for example links at the top right, main navigation and then footer navigation. I have found the best way to do this is to use the uComponents multinode picker.
On the Homepage doc type, I add a new property for each navigation that I want, each using the multinode picker data type. I then choose the pages that I want to appear in the navigation using those pickers. That way you can pull in content into the navigation from anywhere in the site! To use them, just create a macro for each one that uses the node IDs stored in the property to build the navigation.
Hope that helps!
:)
Hi Martin
You can do this in several ways. One way is the option that Tim suggested using some kind of multiple node picker. Another way could be to put a checkbox on your nodes that can be checked if the node should be vissible in the top. Either way I'd suggest that you create the nodes under you Home-node to keep all other navigation intact.
Just a small tip on your xslt. I think you can save some lines of code by changing your a-element to somethink like this:
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="class">
<xsl:value-of select="concat('navItem',position() + number(1))" />
<xsl:if test="$currentPage/ancestor-or-self::*[@isDoc]/@id = @id">
<xsl:text> selected</xsl:text>
</xsl:if>
</xsl:attribute>
<xsl:value-of select="@nodeName" />
</a>
/Kim A
is working on a reply...