Copied to clipboard

Flag this post as spam?

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


  • Dave Brislane 15 posts 46 karma points
    Jul 06, 2011 @ 17:40
    Dave Brislane
    0

    Pulling in Child Page data/Sibling data

    Hi All.

    I have been fighting a losing battle for the last day on this.  What I want to do is have a page (Root Page) that pulls through data from it's child pages into a left hand navigation.  However when you go to a child page I still want the left nav on that page to contain the same information (i.e. from the pages that are on the same level).

    i.e. 

    Root Page (with left nav containing data from child pages)

    --Child Page (same left nav as root page pulling through same data)

    --Child Page (same left nav as root page pulling through same data)

    I've tried all sorts of suggestions in my XSLT, but I just can't get it to work.

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

    The above works on the Root page however obviously when you click a child page nothing is then pulled through.  I've tried doctoring it with parent, descendant etc but just can't get it to work.

    I've got similar stuff working in Umbraco 4.0 however I am using 4.7 for this project and assume I am doing something incorrect on the new schema.

    If anyone has any suggestions they would be gratefully received.

    Thanks in advance.

    Dave.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jul 06, 2011 @ 18:15
    Tom Fulton
    0

    Hi Dave,

    To make the XSLT always pull from the same page, you can use something like

    <xsl:for-each select="$currentPage/ancestor-or-self::RootPage [@isDoc]/* [@isDoc and string(umbracoNaviHide) != '1']">

    Assuming the alias of the "Root Page" document type is "RootPage" - if not just change it next to ::

    Hope this helps,
    Tom

Please Sign in or register to post replies

Write your reply to:

Draft