Copied to clipboard

Flag this post as spam?

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


  • Jamie Howarth 306 posts 773 karma points c-trib
    Jul 19, 2012 @ 13:34
    Jamie Howarth
    0

    Support for advanced XPath/XSLT extensions in MNTP

    Hi guys,

    It'd be great if I could specify an XPath to filter items based on an existing page field (such as an ID or something).

    I have an example with a Media MNTP field, where I want to use the following XPath:

    /*[myPrimaryID=$currentPage/myPrimaryID or Exslt.ExsltStrings:split(mySecondaryID,',')//token = $currentPage/myPrimaryID]

    My "File" media type has two fields - one is a string, and one is a comma-separated list of strings.

    This would be a really useful feature. Can submit a pull request via Codeplex too.

    Cheers,

    Benjamin

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jul 19, 2012 @ 14:46
    Lee Kelleher
    0

    Hi Benjamin,

    I agree, it would be a killer feature!

    I have looked at using custom extension methods with an XPath expression, but the code involved was extremely overkill compared to what we would achieve.

    Deep in the uQuery source-code, (in "uQuery-Nodes.cs"), I have this comment:

    // [LK] Interested in exploring options to call custom extension methods in XPath expressions.
    // http://msdn.microsoft.com/en-us/library/ms950806.aspx
    // http://msdn.microsoft.com/en-us/library/dd567715.aspx
    // Alternative is to render a Clean.xslt with the desired XPath, returning nodeIds

     

    We're open to all suggestions! :-)

    Cheers, Lee.

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jul 19, 2012 @ 14:47
    Lee Kelleher
    0

    ... forgot to say, $currentPage is already supported - we also have another param/variable called $ancestorOrSelf - which gets the first published ancestor node (or self - aka $currentPage)

Please Sign in or register to post replies

Write your reply to:

Draft