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
    Dec 17, 2012 @ 14:32
    Anthony Candaele
    0

    XPath for selecting nodes in subfolders

    Hi,

    I'm using the MNTP component for selecting publication items on a member node:

    I'm trying to read out the publication items using the folling XPath statement:

    descendant::PublicationItem[@isDoc]

    But this doesn't result in a list of publication items on the publication tab in the member node.

    Anyone any suggestions for an XPath query that will enable the selection of publication items from the Member item node?

    Thanks for your help,

    Anthony

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Dec 17, 2012 @ 14:51
    Chriztian Steinmeier
    1

    Hi Anthony,

    You need to go up to a common ancestor and then down Publications branch - so:

    ancestor::ALIAS_OF_COMMON_PARENT/Publications//PublicationItem

    (Assuming the Publications node's alias is also Publications)

    Alternatively, MNTP usually has a $parentPage variable you can use:

    $parentPage/../Publications//PublicationItem

     

    /Chriztian

  • Anthony Candaele 1197 posts 2049 karma points
    Dec 17, 2012 @ 15:10
    Anthony Candaele
    0

    Hi Chriztian,

    Thanks for your help,

    I tried ancestor::SiteSettings/PublicationFolderYear

    But this isn't exactly what I'm looking for, as it is just selecting the first year folder under Publication Area

    But I understand why, as the MNTP-datatype under the Developer-section clearly states that:

    "This XPath expression should be written to match ONE node, if the expression matches more than one node, then the first node matched will be used as the start node."

    So I reverted back to just choosing a Start Node using the Node Picker, and everything works fine

    Maybe the reason why the Node Picker didn't work the first time was because my Start Node Id got corrupted.

    Thanks for your help anyway, and maybe I can help someone else struggling with XPath :)

    greetings,

    Anthony

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Dec 17, 2012 @ 15:16
    Chriztian Steinmeier
    0

    Ah OK,

    Didn't catch that you we're asking about the start node XPath - I thought this was for the filtering (to include or exclude items).

    /Chriztian

     

Please Sign in or register to post replies

Write your reply to:

Draft