Bi-directional one-to-many and many-to-many relationships in Sitecore

Sitecore out-of-the-box does not come with a feature built-in that would allow you to setup bi-directional relationship between items. Hence, I have decided to write my own solution and share it with the community.

John has done a great job describing the various ways how item updates can be intercepted in the following post.

The two options that I identified as the most viable were either write a custom Sitecore handler for the OnItemSaved event (option 1) or write a rule (option 4). The advantages for the rule mentioned by John convinced me that this would be the best option. Here are some of the reasons summarised:

  • Control logic and parameters through UI from content authoring environment
  • Separation of concerns: Rule condition under which the rule runs is part of the configuration
  • Rule only executes on the database that it is configured

Continue reading “Bi-directional one-to-many and many-to-many relationships in Sitecore”