I'm having difficulties finding the answer from search so I'll just create a new thread.
I installed the runway drop down menu package and created a news items. I'd like to hide the news items from populating in the drop down menu. My node type alias is "NewsItem" and the standard Runway Drop Down Menu package xslt looks like the following..
I'd also like to apply this to FAQ nodestypes from the Runway FAQ module
Thats what I added before but then everytime I reloaded my page, my menu disappeared. I'm an Umbraco newb so I'm not sure how to debug this.. This is what I changed it to..
Hide Nodetypes from Runway Drop Down Menu
I'm having difficulties finding the answer from search so I'll just create a new thread.
I installed the runway drop down menu package and created a news items. I'd like to hide the news items from populating in the drop down menu. My node type alias is "NewsItem" and the standard Runway Drop Down Menu package xslt looks like the following..
I'd also like to apply this to FAQ nodestypes from the Runway FAQ module
<?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" exclude-result-prefixes="msxml
umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<!-- update this variable on how deep your navigation should be -->
<xsl:variable name="maxLevel" select="5"/>
<xsl:template match="/">
<xsl:value-of select="umbraco.library:AddJquery()"/>
<xsl:value-of select="umbraco.library:RegisterJavaScriptFile('droppyJs', '/scripts/droppy.js')"/>
<xsl:value-of select="umbraco.library:RegisterStyleSheetFile('droppyCss', '/css/dropdownnavigation.css')"/>
<xsl:variable name="droppyJS">$(function() {$('#dropdownNavigation').droppy();});</xsl:variable>
<xsl:value-of select="umbraco.library:RegisterClientScriptBlock('droppyJs', $droppyJS, true())"/>
<ul id="dropdownNavigation">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@level=1 and @isDoc]"/>
</xsl:call-template>
</ul>
</xsl:template>
<xsl:template name="drawNodes">
<xsl:param name="parent"/>
<xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
<xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevel]">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
<xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevel]) > 0">
<ul>
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</ul>
</xsl:if>
</li>
</xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Hi Carlo,
you can easily exclude news items from the list by replacing this line
<xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevel]">
with this
<xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevel and @nodeTypeAlias != 'NewsItem']">
If you want to exclude the FAQ items as well you just need to add another
to the list.
Hope that helps,
Sascha
Thats what I added before but then everytime I reloaded my page, my menu disappeared. I'm an Umbraco newb so I'm not sure how to debug this.. This is what I changed it to..
this worked!
Interesting, glad you figured it out! :)
with the new schema you can exclude nodes by type using :
in the pre 4.5 schema you could use:
http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/xslt-examples-updated-to-new-schema
is working on a reply...