Copied to clipboard

Flag this post as spam?

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


  • Echilon 29 posts 49 karma points
    Sep 28, 2010 @ 11:11
    Echilon
    0

    4.5 Subnavigation

    I'm trying to convert a 4.0 XSLT subnavigation template to 4.5 and have hit a wall. First the working 4.0 XSLT

    4.0 XSLT - Works
     <xsl:if test="count(./node [string(./data [@alias='umbracoNaviHide']) != '1']) > 0 and (($currentPage/ancestor::node[@level=2]/@id = ./parent/@id) or ($currentPage/@id = @id) or ($currentPage/ancestor::node[@level=2]/@id) = @id)  ">
                                    <ul>
                                        <xsl:call-template name="drawNodes">
                                            <xsl:with-param name="parent" select="." />
                                        </xsl:call-template>
                                    </ul>
                                </xsl:if>

    If I have a node tree like:
    Home
    |-Item1
    |-Item2
      |-Sub Item 1
      |-Sub Item 2
      |-Sub Item 3
    |-Item3

    When The user is on 'Home', or any of the top items, they should only see the top items. If they're on 'Item2' or 'Sub Item2', they should see the sub item navigation. I've tried checking the current ID in the loop against:
    -currentPage/ancestor::* [@level=2]/@id" />
    -currentPage/node::*/@id" />

    And pretty much everything else. So far the closest I've found is:

    4.5 XSLT - Closest match I've found
     <xsl:if test="count(* [@isDoc and string(umbracoNaviHide) != '1']) > 0">
    ...

    This must be possible in 4.5, I'm sure I just don't have the right XSLT.

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Sep 28, 2010 @ 11:14
    Ismail Mayat
    0

    Echilon,

    Flexible cognavigation is your friend it does expanding tree nav and much more and is now 4.5 compatible see http://our.umbraco.org/projects/website-utilities/cogworks-flexible-navigation

    Regards

    Ismail

  • Echilon 29 posts 49 karma points
    Sep 28, 2010 @ 12:00
    Echilon
    0

    Thanks, I'll remember the template for future. :)

Please Sign in or register to post replies

Write your reply to:

Draft