Copied to clipboard

Flag this post as spam?

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


  • Hugo Migneron 32 posts 105 karma points
    Oct 24, 2013 @ 19:38
    Hugo Migneron
    0

    Interdependent Data Types

    Hi,

    I am looking for a way to do something similar to what Country / State or Province dropdowns do on some sites. That is : 2 dropdown, 1 for country, 1 for province. When you select an item in Country, the Province dropdown fills out with only the provinces of that country.

    My case is not quite as simple though (the data is not static and it is instead based on umbraco content). Instead of Country / Province, I am working with Categories and Items.

    So my site tree has a section of the site tree that looks like this : 
    +Parent
    + Category1
        Item1
        Item2
        Item3
    + Category2
        Item4
        Item5
        Item6
    + Category3
        Item7
        Item8
        Item9

    Then I have document type on the site that I want to link to the items. The document type has a few properties, including a Category and an Item :

    Title
    Description
    Category (Dropdown list that offers "Category1", "Category2", "Category3")
    Item (Dropdown that offers items based on the selected Category)

    I was thinking that the way to do this would be to create 2 new data types, both of type Ultimate Picker.

    • The first one only takes the nodes under Parent of the document type Category.
    • The second one only takes the nodes under Parent (with Show Grandchildren activated) of the document type Item
    The problem is that now, you can select "Category1" and "Item8". I want to make it so that when you select "Category1", you can only select "Item1", "Item2" or "Item3".

    I looked at a few solutions like Embedded Content but that only really groups properties together, it doesn't filter. I also need to be able to search based on the 2 properties using Examine so something like the SQL DropDown list where I manage my categories and items myself outside of Umbraco doesn't really work for me either.

    How should I achieve this?

    Thanks a lot for your help!

Please Sign in or register to post replies

Write your reply to:

Draft