Copied to clipboard

Flag this post as spam?

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


  • nandoDel 8 posts 98 karma points
    Dec 15, 2017 @ 13:07
    nandoDel
    0

    Umbraco MultinodeTreePickker Filter

    Hi guys,

    I'm developing a kind of blog shaped by news and ads. Each of one in a different folder under de root node. Under another root node for global settings i set a list of categories. Each category would have a checkbox property named "TypePost" with the news and ads option, in a way that it is possible to select one or both options when a category is created.

    Both the document types used to create news posts and ads posts have a multinodetreepicker property with wich one or several categories can be selected. So the idea is to look for a way it is possible to choose only the categories nodes that have the property "TypePost" set in correspondence with the type of post.

    So, if the publisher is creating a news post (with the document type "news") only can see in the tree the categories that have the property TypePost with the option news selected.

    Any idea to achieve this? it is possible modify in some way the multinodetreepicker datatype or to create a kind of plugin to achieve this? Thanks for any advice

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Dec 16, 2017 @ 14:22
    Marc Goodson
    0

    Hi nandoDel

    The way I've tackled this in the past is to have a different Document Type for the different type of category, with both sharing the same properties (perhaps via a common composition)

    If you Ad Category is a different document type to your News Category, then they can have different icons in the back office and it's easier for editors to identify which type of category they are picking.

    Here is an example of a picker I had on a site with 8 different types of categories...

    enter image description here

    You also suggest you have a different document type for News Items and Advert Items, so these could both have a different Multinode Tree Picker, one for picking News Categories and one tied down to picking Ad Categories.

    You could limit the categories these pickers are able to pick either by using the 'Allow Items of type' option on the picker or if you keep your categories as one doc type, have them in different folders, and set the Start node for your picker to only pick categories from the appropriate folder.

    or if you need News articles to be able to be tagged with Ad Categories and vice versa, then you could take a similar approach to that in the screenshot, and have one picker to pick News Categories and another to pick Ad Categories, combining them when you write the out in the template.

    regards

    Marc

  • nandoDel 8 posts 98 karma points
    Dec 24, 2017 @ 14:22
    nandoDel
    0

    Hi Marc,

    Thanks for your approach, the way I'm looking for is what you described in the last paragraph:

    "or if you need News articles to be able to be tagged with Ad Categories and vice versa, then you could take a similar approach to that in the screenshot, and have one picker to pick News Categories and another to pick Ad Categories, combining them when you write the out in the template.",

    but this way i can not restrict the use of certain categories for example tagging News articles with Ad Categories where some Ad Categories i prefer not to be possible be used to tag News articles while other yes.

    I was trying to achieve this with the package nuPickers, with the xml checkbox picker to get a list of nodes with an alias "category" wich are under a node with alias "categories". The document type "category" would have a property of data type checkbox list with two options: news and ads.

    In this way i'm trying to achieve that the checkbox list generated by the xml checkbox picker only show the "category" nodes with for example the value 'news' selected or the value "ads" selected.

    The xpath set for any other simple property type like TextString is this: //categories//category[testProperty = 'test'] according to the documentation https://github.com/uComponents/nuPickers/wiki/Data-Source-Xml, but i need to get the categories with one of the checkbox options selected,

    i will see if it is possible achieve this with nuPicker, or i will use your approach of using a different Document Type for the different type of category,

    Regards,

    nandoDel

Please Sign in or register to post replies

Write your reply to:

Draft