Copied to clipboard

Flag this post as spam?

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


  • Luis Pedro 29 posts 151 karma points
    Dec 02, 2019 @ 10:15
    Luis Pedro
    0

    Filter results with Multinode TreePicker

    Hello all.

    I have a doc type for classifying my docs (blogs, event, pr's, products, etc), which has some check-boxes where I can set up where the category can be used.

    On the document type itself, when using this category picker (multinode tree picker), I want to the define the picker to point to that 'folder', but only choosing the items according to the pretended doc type... For example: when writing a blog post, I only want that my multinode tree picker to select the items that has 'Is Blogpost' checked, ... the same when defining an Event ('Is Event' checked)... etc.

    How can I do that? Will XPath do the job? (don't know nothing about xpath)

    Thanks. /Luisenter image description here

  • Dmitriy 168 posts 588 karma points
    Dec 02, 2019 @ 12:54
    Dmitriy
    0

    XPATH is some kind of query language for XML, in umbraco case for xml cache. Open App_Data/umbraco.config and you will see how your xml cache looks like.

    First of all, see the axis extensions for Umbraco XPATH here

    In your case, you can use constraint syntax like //[@isBlogpost=1], but check this is relate to your umbraco cache (umbraco.config) before.

    But, after all, with your architecture style you will get a lot of problems with that if you need to extend your solution in future.

    If you will use separated document types it be possible to use builtin xpath type constraints settings.

    Hope it helps.

  • Luis Pedro 29 posts 151 karma points
    Dec 02, 2019 @ 16:39
    Luis Pedro
    0

    Thank's Dmitriy, I'll have a look

    Basically what it pretend is only to pick these ones when clicking Add, which are filtered with the checkbox 'isProduct' checked... all the other ones shouldn't be available for picking... and should start in that folder.

    Do you know if I can have an xpath filter with somekind of condition on the nodename? something like [@nodeName.contains('.prod')] would do the same if possible.

    enter image description here

  • Carlos Mosqueda 242 posts 433 karma points
    Dec 02, 2019 @ 18:45
    Carlos Mosqueda
    0

    Hi @Luis,

    Typically for the Multinode tree pickers, it would be better suited to make separate doctypes or datatypes with those specific types.

    You would then in your doctype for a 'blog post', have a property list only for those posts. I guess you could try to code around it, but then you are fighting against Umbraco.

    So , my suggestion would be to make all you blog post types as one property list and have the multinode tree picker only pick those.

    Usually you can have multiple multi node tree pickers with specific nodes they can take . Does that make sense?

    Instead of having "Global Properties" , you would have "Prod" properties or "Blog Post" properties and then in your mulitnode tree picker, you would choose that as your type.

  • Luis Pedro 29 posts 151 karma points
    Dec 03, 2019 @ 08:03
    Luis Pedro
    0

    Hi Carlos, Thanks for your reply.

    I understand your point of view, and that's what I had on V1 of my solution.

    The problem is that, considering that I have those 7 sections (mentioned above [product, blog, event, press, ...]), and if I have one single category that fits on those 7 sections, I would need to have 7 docs, each one inside that group, ... and I have 12 languages, which represents 7x12=84 translations for the same title/text.

    By being able to filter, I would only have one single 7 category, with the same 12 translations, but I would be able to filter it according to the need: will pull all that are @isBlogpost = true when classifying blogposts, discarding all the other ones, or will pull @isProduct when classifying a product page, etc, etc.

Please Sign in or register to post replies

Write your reply to:

Draft