Hi,
I do have a problem - i need to exclude a specific menu item, caled "blog" in the footer mega-menu.
The item need to be in my global menu - so i was wondering how i do exclude a single item from one menu, and not the other.
My code as for now:
<ul title="Top navigation" class="dwnavigation" id="footerul" settings="startlevel:1;endlevel:2;expandmode:All;">
Greetings
Joachim
Developer forum
E-mail notifications
Exclude menu item in specific menu
Posted on 18/01/2011 10:50:06
Replies
Posted on 18/01/2011 11:01:24
Hi there,
You could use a separate XSLT file for the Footer menu and filter out the item by its ID.
Imar
You could use a separate XSLT file for the Footer menu and filter out the item by its ID.
Imar
Posted on 18/01/2011 12:05:30
Hi Joachim,
You can use Test in XSLT, could be done like this: (if the ID is "1").
You can use Test in XSLT, could be done like this: (if the ID is "1").
<xsl:choose>
<xsl:when test="@ID!='1'">
<a class="{@class}">
<xsl:attribute name="href">
<xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/>
</xsl:attribute>
<xsl:value-of select="@MenuText" disable-output-escaping="yes"/>
</a>
</xsl:when>
</xsl:choose>
Posted on 18/01/2011 12:45:16
That works perfectly! Thanks alot.
Im very sorry, but im all new to xslt, and i have some very basical questions.
How do you use "mode" expand:all? Now i only gets the level 1 item's
Here is my code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes" encoding="utf-8" />
<xsl:param name="html-content-type" />
<xsl:template match="/NavigationTree">
<ul class="M0">
<xsl:apply-templates select="Page">
</xsl:apply-templates>
</ul>
</xsl:template>
<xsl:template match="Page">
<li class="{@class}">
<xsl:choose>
<xsl:when test="@ID!='6'">
<a class="{@class}">
<xsl:attribute name="href">
<xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/>
</xsl:attribute>
<xsl:value-of select="@MenuText" disable-output-escaping="yes"/>
</a>
</xsl:when>
</xsl:choose>
</li>
</xsl:template>
</xsl:stylesheet>
Im very sorry, but im all new to xslt, and i have some very basical questions.
How do you use "mode" expand:all? Now i only gets the level 1 item's
Here is my code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes" encoding="utf-8" />
<xsl:param name="html-content-type" />
<xsl:template match="/NavigationTree">
<ul class="M0">
<xsl:apply-templates select="Page">
</xsl:apply-templates>
</ul>
</xsl:template>
<xsl:template match="Page">
<li class="{@class}">
<xsl:choose>
<xsl:when test="@ID!='6'">
<a class="{@class}">
<xsl:attribute name="href">
<xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/>
</xsl:attribute>
<xsl:value-of select="@MenuText" disable-output-escaping="yes"/>
</a>
</xsl:when>
</xsl:choose>
</li>
</xsl:template>
</xsl:stylesheet>
Posted on 18/01/2011 13:01:28
Take a look at the file LIClean.xslt from the /Files/Templates/Navigation folder.
It recursively builds up the menu by calling <xsl:apply-templates select="Page"> again. You may want to use this file as your starting point as it's one the cleaner XSLT files for navigation.
Hope this helps,
Imar
It recursively builds up the menu by calling <xsl:apply-templates select="Page"> again. You may want to use this file as your starting point as it's one the cleaner XSLT files for navigation.
Hope this helps,
Imar
Posted on 18/01/2011 13:42:32
Works perfectly, and as intended now.
Thanks for the help both of you!
- Joachim
Thanks for the help both of you!
- Joachim
You must be logged in to post in the forum