Umbraco: Associated items to multiple tag groups

563 views Asked by At

Assuming we have 2 document types: TagGroup [DisplayName] and TagGroupItem [DisplayName] with TagGroupItems being children of TagGroup. That said, assume we have the following data:

Color - Red - Green - Blue

Finish - Aluminum - Plastic

Color and Finish are both TagGroups. What kind of data type would allow for the another item to be associated with 1 or more tag group items? That is, an item could be Color-Red and Finish-Alumimum or just Color-Red. Aside from manually creating a drop down for each tag group and associating it to an item, how can this be more streamlined?

1

There are 1 answers

0
marapet On BEST ANSWER

You may try to do this with Multi-Node Tree Picker of the great uComponents package.

Create a datatype based on Multi-node tree picker, configure it to allow only TagGroupItems to be selected (using XPathFilter).

Every document type which needs to be associated with x TagGroupItems then simply needs one property using this datatype.

This of course would allow to choose more than one TagGroupItem from the same TagGroup (for example red and green). If you'd like to enforce having only 0 or one TagGroupItem linked, you could define a datatype for each TagGroup, limited to their TagGroupItems and Maximum node selection set to 1.