I am looking for some advice on how to best approach creating a complex datatype. I have built only simple data types before but this requirement requires dependency on previous selections and all values need to be stored in order for the hierarchy to redisplayed later on. The datatype is for a Member property and would form the following structure:
Cat 1 |- Cat 2 |- Cat 3
Cat 2 options would be dependent on Cat 1 selection and Cat 3 dependent on Cat 2. In some cases there may never be a Cat 2 option and likewise for Cat 3. In terms of storing this in the database my first thought would be to store values as a delimeted string but before I go to far I was hoping for some feedback or alternative ideas.
I wouldn't make it too overly complex and also go for the simple solution, being a custom datatype with three dropdowns and storing data as delimited string, as this is closest to the umbraco infrastructure/architecture. A custom table to hold the category info would be overhead imho,
But don't you still need some place/way to store which cats/options hierarchy, in order to present the user with the option lists in the control dropdowns?
I'd probably look into a using a custom xml-file for this hierarchy, and then storing the option-ids as a delimited string from the datatype as Dirk suggested.
Advice on creating complex datatype
I am looking for some advice on how to best approach creating a complex datatype. I have built only simple data types before but this requirement requires dependency on previous selections and all values need to be stored in order for the hierarchy to redisplayed later on. The datatype is for a Member property and would form the following structure:
Cat 1
|- Cat 2
|- Cat 3
Cat 2 options would be dependent on Cat 1 selection and Cat 3 dependent on Cat 2. In some cases there may never be a Cat 2 option and likewise for Cat 3. In terms of storing this in the database my first thought would be to store values as a delimeted string but before I go to far I was hoping for some feedback or alternative ideas.
Thanks, Simon
Hi Simon,
I wouldn't make it too overly complex and also go for the simple solution, being a custom datatype with three dropdowns and storing data as delimited string, as this is closest to the umbraco infrastructure/architecture. A custom table to hold the category info would be overhead imho,
Hope this helps.
Regards,
/Dirk
I'm glad you said that as I was hoping there would be little need to make it any more complex than that.
But don't you still need some place/way to store which cats/options hierarchy, in order to present the user with the option lists in the control dropdowns?
I'd probably look into a using a custom xml-file for this hierarchy, and then storing the option-ids as a delimited string from the datatype as Dirk suggested.
Regards
Jesper Hauge
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.