Copied to clipboard

Flag this post as spam?

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


  • Joseph 59 posts 140 karma points
    Mar 04, 2015 @ 23:02
    Joseph
    0

    MNTP xpath query to select start node broken in Umbraco 7

    Hello

    I've used the following xpath query in Umbraco 6 to set the start node for a MNTP control:

    root/CommonContent//FilterCategoryCollection[$parentPage/ancestor-or-self::*[filterMasterCategories != '']/filterMasterCategories = @id]
    

    Basically, a collection of filter types are setup in common content and configured in the listing page (parent) as a property with alias filterMasterCategories. This way, the child pages of that listing page only has access to the filter types configured to the listing.

    This doesn't seem to work however in Umbraco 7; I get the following error:

    Failed to retrieve entity data for query root/CommonContent//FilterCategoryCollection[$parent/ancestor-or-self::*[filterMasterCategories != '']/filterMasterCategories = @id]

    Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.

    Was there a change in syntax between Umbraco 6 and 7?

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Mar 04, 2015 @ 23:36
    Chriztian Steinmeier
    0

    Hi Joseph,

    I believe $parentPage is just $parent in the Umbraco 7 version...

    /Chriztian

  • Joseph 59 posts 140 karma points
    Mar 04, 2015 @ 23:44
    Joseph
    0

    Thanks Chriztian - I should have mention I did try that (and the error message that I got returned reflects it).

    Any other ideas?

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Mar 04, 2015 @ 23:52
    Chriztian Steinmeier
    0

    Hi Joseph,

    (and the error message that I got returned reflects it)

    Yeah, I see that now - my bad :(

    Well, it looks like someone forgot to implement this correct - I don't think there's much you can do...

    Is it only when you use $parent or does it fail for the other placeholders as well?

    /Chriztian

  • Joseph 59 posts 140 karma points
    Mar 05, 2015 @ 00:50
    Joseph
    0

    I just stuck $current in there (in place of $parent) and got the same error message.

    Is there a way for me to access the parent node without using the $parent placeholder?

  • Joseph 59 posts 140 karma points
    Mar 05, 2015 @ 04:23
    Joseph
    0

    Raised ticket for this here: http://issues.umbraco.org/issue/U4-6364

Please Sign in or register to post replies

Write your reply to:

Draft