Sitecore: Express Subitem Module

March 27, 2015 Mike Skutta

As part of our efforts to share the latest technologies and capabilities in the world of digital marketing and web development, we’ll be posting a series of articles on Sitecore, one of the most impressive experience platforms available today. Though this post will primarily be relevant to developers, we hope the content remains interesting to all of our readers and provides some insight into the more technical aspects of the digital development world.

Overview

We had a need to support relationships in Sitecore that also contained metadata or supplemental information about a relationship or multiple relationships. Examples of these types of relationships are:

  1. The organizations a person belongs to and the roles they play within the organization.
  2. The offices an employee belongs to including their contact information for that office.
  3. A person’s education with the School, Degree, Description, and year obtained.

This information is specific to the item (parent) that owns it. No other item has the same information. In these particular cases the information is part of the parent item. The information only exists if the parent exists. If the parent is deleted, this information is also deleted.

Sitecore

Sitecore supports this concept via parent and child items. The child items only exist if the parent exists. If the parent is deleted, the children are also deleted. Using the above examples we can see how this may work:

  1. A Person would be the parent item. The child items would be an Organization Information item. The Organization Information would contain the relationship to the organization as well as a role field.
  2. An Employee would be the parent item. The child items would be an Office Information item. The Office Information item would contain the relationship to the office as well as supplemental Phone number fields and maybe desk location fields.
  3. A Person would be the parent item. The child would be an Education item. The education item would contain relationships to the School and Degree. Additional fields would exist for the description and the year the degree was obtained.

In simple cases the children can be direct children of the parent. In cases where more than one relationship type exists, the children can be placed in sub-folders. In the above example the education records and the organization records could be placed into sub-folders under the same person for better separation. Insert Options can be configured to limit the types of children that can be added.

Using the above approach, the content administrator needs to work with multiple items (parent and children) at a time, even though the information is really part of a single record. We wanted to try to improve this user experience by removing the need to go to many individual items to update a single record. We wanted the content administrator to see and edit all the information on a record all at once. What we came up with was the Express Subitem Module.

Express Subitem Module

The Express Subitem Module brings the experience of editing child items within the context of the parent item. The parent and child items still exist, but the child items and folders are hidden so the content administrator does not need to be concerned maintaining separate child items.

The child items are actually editable within the same view as the parent item. Links are provided to add and delete the child items.

Image 1

Image 2

Because the child items are hidden from the content administrator we had to implement the following:

  • The child items are automatically versioned along with the parent item. If the parent is at version 7, the child items will also be at version 7.
  • Publishing settings are mirrored from the parent to the child items
  • Workflow settings are mirrored from the parent to the child items.
  • Locks are also mirrored from the parent to the child items.
  • The child items are automatically named via configurable replacement tokens.
  • Validation errors on the child items are visible when editing within the parent.
  • The Express Subitem was implemented as a custom field type. The child item ids are stored within the field as if the field was a Multilist field. This allows easy look-up of the managed child items.
Note: The child items are hidden. When manually publishing it is important to include sub-items. One way to prevent the content administrator from forgetting to publish the sub-items, is to create a custom workflow.


Our clients have found this module to be very useful, improving the overall user experience, and we hope you do too. We have made this module available for everyone to use. The source code and releases are located at GitHub.

This module is also available on the Sitecore Marketplace.

Want to read more Sitecore tips and tricks? Check out my post, Sitecore: Using NuGet to Add Items to TDS Projects > >

Interested in learning more or joining the team? Let's talk.

Subscribe

The One North Ideas Update delivers each month’s latest posts on digital for PSOs—including industry trends, news and our latest research—directly to your inbox. Although it’s our goal to always include thought-provoking and compelling content, you can unsubscribe at any time. 

See our Privacy Policy to learn more about how we protect and manage your submitted data.

Mike Skutta Architect

As an Architect within the Technology Labs group at One North, Mike works to research, test and integrate new technologies for both One North and its clients. He is also a Sitecore Technology MVP – a distinction received by only 217 people worldwide – and holds more than 14 years of experience architecting, designing, developing software and leading technology teams. Based in Florida, Mike is often seen wheeling around the office via our robot.

  • Favorite vending machine snack: Doritos
  • Most unusual job: Working as a Serf at Medieval Times

One North Interactive 
222 North LaSalle St, #1500
Chicago, IL 60601

+1 312.469.1740