Copied to clipboard

Flag this post as spam?

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


  • mark 5 posts 7 karma points
    Jul 02, 2009 @ 12:57
    mark
    0

    XSLT IF clause for navigation

    Hi,

    I've used one of the provided XSLT templates to display the child nodes of the current page for my navigation. My tree structure is:

    - Home

    ..etc

    When you're on the About Us page, it correctly writes out the About Us Sub1 and Sub2 Pages. Same with Products. However, because of the tree structure, if you're on the homepage, it writes out About Us, Products etc as if they're 2nd level pages. I want it to *think* that Home, About Us, Products etc are all on the same level (without changing the tree structure), and to write out NOTHING if you're on the home page. I thought the easiest solution would be to put an xsl "if" clause that only writes out the for-each statement if you're NOT on the homepage, but I can't get the syntax correct. Can someone show me what to add?

    Thanks!

     

    Here's the XSLT:

     

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 02, 2009 @ 13:10
    Dirk De Grave
    0

    Might be a good idea to format your xslt as it looks rather crap right now!

     

    -Copy code over to notepad (THE ultimate editor)

    -Copy from notepad over here

    -Select text and use preformatted style from the dropdown

     

    Cheers,

    /Dirk

  • mark 5 posts 7 karma points
    Jul 02, 2009 @ 13:15
    mark
    1

    Thanks Dirk. 

    Once more with feeling...

     

     

    <xsl:stylesheet 
  • Kenneth Solberg 227 posts 418 karma points
    Jul 02, 2009 @ 13:54
    Kenneth Solberg
    0
    <xsl:for-each select="$currentPage/node [@level &gt; 1 and string(data [@alias = 'umbracoNaviHide']) != '1']">
    :
    </xsl:if>

     

Please Sign in or register to post replies

Write your reply to:

Draft