can't access the content property in Xslt top navigation
Hello,
I have this xslt code for my top navigation. I use the property showLink because there are links on my top navigation that I don't want to show any landing page.
I'm not sure what your issue is, but it's convention in Umbraco to use the property 'umbracoNaviHide' when you want to hide something from navigation.
Change your 'showLink' property to 'umbracoNaviHide', create a new XSLT file and use the 'Navigation Prototype' from the templates, this should be a great starting point for setting up your nav.
You'll notice that in many XSLT templates / 3rd party XSLT files that 'umbracoNaviHide' is used.
I actually wanted to show the navigation. This is somehow different from umbracoNaviHide.
What I want to achieve is to replace the value of href.
For example
Hotel - If a user hover on this link the href values should be "#" bec I don't want to show any page/content here once they click it. I still want this to be shown that's why I created another property aside from the umbracoNaviHide.
Hotel 1
Hotel 2
Meetings and Events - For this 2nd link I want the href values to have the value of the page because once they click it, I will display the content/page.
As Rik says, it would be helpful if you give us more information, what is not working, what is your output and also an image of your content structure would help clarify things.
can't access the content property in Xslt top navigation
Hello,
I have this xslt code for my top navigation. I use the property showLink because there are links on my top navigation that I don't want to show any landing page.
Example:
My problem is I can't get this to work.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" />
<!-- Input the documenttype you want here -->
<xsl:template match="/">
<ul id="nav">
<li><a href="/florahospitality" id="navMain1">Home</a></li>
<xsl:apply-templates select="$siteRoot/*[@isDoc]" />
</ul>
</xsl:template>
<!-- The fun starts here -->
<xsl:template match="*[@isDoc]">
<li >
<a href="{umbraco.library:NiceUrl(@id)}" id="navMain2">
<xsl:if test="$currentPage/showLink = 0">
<xsl:attribute name="href">#</xsl:attribute>
</xsl:if>
<xsl:value-of select="@nodeName" />
</a>
<xsl:if test="*[@isDoc][not(umbracoNaviHide = 1)] and current()[@level = 2]">
<ul>
<xsl:apply-templates select="*[@isDoc]" />
</ul>
</xsl:if>
</li>
</xsl:template>
<!-- Never output these and current()[@level = 2]-->
<xsl:template match="*[umbracoNaviHide = 1]" />
</xsl:stylesheet>
I'm not sure what your issue is, but it's convention in Umbraco to use the property 'umbracoNaviHide' when you want to hide something from navigation.
Change your 'showLink' property to 'umbracoNaviHide', create a new XSLT file and use the 'Navigation Prototype' from the templates, this should be a great starting point for setting up your nav.
You'll notice that in many XSLT templates / 3rd party XSLT files that 'umbracoNaviHide' is used.
RIch
"cant get this to work" is a bit vague... what output do you get?
Hi Rich,
I actually wanted to show the navigation. This is somehow different from umbracoNaviHide.
What I want to achieve is to replace the value of href.
For example
Hotel - If a user hover on this link the href values should be "#" bec I don't want to show any page/content here once they click it. I still want this to be shown that's why I created another property aside from the umbracoNaviHide.
Hotel 1
Hotel 2
Meetings and Events - For this 2nd link I want the href values to have the value of the page because once they click it, I will display the content/page.
Meetings and Conferences -
Social Events
Hope I explain it more clearly. :D
Sherry
As Rik says, it would be helpful if you give us more information, what is not working, what is your output and also an image of your content structure would help clarify things.
Rich
issue now solved...
is working on a reply...