Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Matthew Jarvis 129 posts 129 karma points
    Oct 13, 2011 @ 19:37
    Matthew Jarvis

    Menu navigation help

    I currently have the following menu on my website (where my mouse is currently hovering over Testuser)

    This is my XSLT for the above


     <xsl:template match="*">

    <xsl:if test="umbraco.library:HasAccess(@id, @path) = true()">
            <a title="{nodeName}">
              <xsl:attribute name="href">
                      <xsl:value-of select="umbraco.library:NiceUrl(@id)" />
              <xsl:attribute name="class">level<xsl:value-of select="@level" />
                <xsl:if test="position() = 1"><xsl:text> firstxsl:text>xsl:if>
                <xsl:if test="position() = last()"><xsl:text> xsl:text>lastxsl:if>
                <xsl:if test="$currentPage/ancestor::*/@id = current()/@id"><xsl:text> xsl:text>expandedxsl:if>
                <xsl:if test="@id = $currentPage/@id"><xsl:text> xsl:text>currentxsl:if>
                <xsl:if test="count(./*[string(umbracoNaviHide) != '1']) > 0"><xsl:text> xsl:text>parentxsl:if>
                 -<xsl:value-of select="umbraco.library:Item(@id, 'pageName')"/> <xsl:if test="count(./*[@isDoc]) > 0"> xsl:if>
            <xsl:if test="count(./*[string(umbracoNaviHide) != '1']) > 0">
              <xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id">
                  <xsl:apply-templates select="./*[@isDoc and string(umbracoNaviHide) != '1']" />

       The web designer however I had to design templates for me, designed the below which I hope to implement

    Which was made possible through the following HTML

    <li><a href="#">Homea>li>
    <li><a href="#">The Collegea>li>
    <li class="current"><a href="#">Coursesa>
                <li class="current"><a href="#">- Work based learninga>li>
                <li ><a href="#">- Course Xa>li>
                <li ><a href="#">- Course Ya>li>
    <li><a href="#">Community Learninga>li>
    <li><a href="#">Student Lifea>li>
    <li><a href="#">News & Eventsa>li>
    <li><a href="#">Centre Traininga>li>


    What I'm really struggling to implement is where I should put the element

    <li class="current">

    in my XSLT.  The example from my designer shows what the menu would look like when the current page is viewed with any sub nodes

    Any guidance would be much appreciated





Please Sign in or register to post replies

Write your reply to: