Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    May 23, 2011 @ 22:32
    Anthony Candaele
    0

    yet another xslt navigation problem

    Hi,

    I just reordered my Content tree for a website. I moved the Nieuws folder. It was previously under the Home node, and I moved it a level up, and now it is under the Site node:

    But now I notice that the Front News xslt macro is working correctly anymore since the NewsArea document type is not located anymore under the Home document type:

    <xsl:for-each select="$currentPage/NewsArea/NewsArticle [@isDoc and string(umbracoNaviHide) != '1']">

    Does anybody know how I can adapt this for-each loop so that the NewsArea document type can be accessed from the Home page?

    Thanks for your help,

    Anthony Candaele

    Belgium

     

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    May 23, 2011 @ 22:41
    Chriztian Steinmeier
    1

    Hi Anthony,

    You can do a couple of different things:

    If you're only using it from the Home node - do this:

    <xsl:for-each select="$currentPage/following-sibling::NewsArea/NewsArticle[@isDoc][not(umbracoNaviHide = 1)]">

    Otherwise, if you'd like a more generic version, this will work on any page in the "Site" website:

    <xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" />
    <xsl:for-each select="$siteRoot/NewsArea/NewsArticle[@isDoc][not(umbracoNaviHide = 1)]">
    

    /Chriztian

  • Anthony Candaele 1197 posts 2049 karma points
    May 23, 2011 @ 22:49
    Anthony Candaele
    0

    Hi Chriztian,

    Thanks a lot. Your solution works. As I just need to read out the news items on the home page, I used your first solution.

     

    Anthony

Please Sign in or register to post replies

Write your reply to:

Draft