Sitecore Roundtable Recap Blog

Tuesday, July 16, 2013 @ 01:25

A Brief Primer of Item Buckets in Sitecore 7: Item Buckets and the Problems They Solve

The longer we work in Sitecore the more often we're reminded how painful it is to manage large sets of data.  With Information Architecture in Sitecore sites, we are always trying to solve the pull between intuitive and speedy content entry and the content tree's fidelity to our sitemap.  Item buckets have existed as an add-in module for Sitecore 6.5 and 6.6, but have enough of their own pain points to make them less than ideal.  Acknowledging the pain the buckets cause in 6.5 and 6.6 Sitecore has redone item buckets and made them a core part of Sitecore 7.

New Search-Enabled Template Fields: Multilist with Search and Treelist with Search

Multilist with search is much as the name implies; in addition to making it easier to find what you’re looking for in larger data sets it also makes organizing your data much simpler.  Rather than the potentially endless pages of items to link the user gets a search box and items to link in pages of 10 at a time.

Setting up the datasource is quite a bit difference in than the regular multilist.  You need to provide three things to the datasource:

  • StartSearchLocation: The GUID of node to search
  • TemplateFilter: The Guid of template by which to narrow
  • Filter=templatekey: The name of the template

The multilist data source has a few quirks in the initial release of Sitecore 7.  Though it seems counter-intuitive, both a TemplateFilter and a Filter=templatekey seem to be required to get the datasource to work correctly.

Almost identical to the multilist with search, the treelist provides essentially the same functionality.  For the datasource you only need to provide the StartSearchLocation and TemplateFilter.  Similar to the multilist with search a StartSearchLocation is provided.  The significant difference here is that the user can set a new StartSearchLocation in the user interface.

Item Buckets

The new search-enabled field type organizes the content in a much easier way. We no longer have to organize our tree in order to make it easy for our linked fields to be found.  No longer is there a need to create artificial structures to organize content item buckets to keep them easily accessible in the tree.

How Item Buckets Work

A bucket is much like it sounds, a structureless collection of indexed items (there is in fact a structure but it is largely irrelevant for this discussion).  When we transform a node into a bucket every node under it that is marked as bucketable, on either an item or a template level, and will be restructured and indexed.  When we then navigate to that node we now get to the children via a search page rather than sub-nodes within the tree.  Simple on the face, but there are a few nuances to keep in mind:

  • Bucketable Field:  Remember to mark the Standard Values of the template as bucketable, not the template itself!
  • Lock Child Relationship: If you need to preserve the parent-child template structure, remember to select the Lock Child Relationship field. It will preserve the structure for use cases such as this.

Setting the Search View

Now that your buckets are setup clicking on an item will yield an empty search page.  There are several customization options available for this view: the Default Bucket Query and the Persistent Bucket Filter.  The former of these two defines a Query that is run immediately when the search page loads, functioning as a sort of “Initial View”.  The user can then enter their own search if the initial view doesn't turn up the item for which their looking. The latter of these two options is the Persistent Bucket Filter which is a filter the user has no ability to override and is used to prevent users from seeing specified items from the bucket.

Quick Actions

Another important configuration point for item buckets are Quick Actions.  A common way to manage content is via the context menu.  Quick Actions largely provide a new place for this functionality.  For any given item or template you can define what actions are available from the search results panel by assign it quick actions.  In addition to these, any insert options you assign to an item will also appear in the items in the search results.

Everything Else!

Keep in mind, this is only a handful of what item buckets can do for you.  For more, I highly encourage you to check out the Developers Guide to Item Buckets.

Other Roundtable Blog Recaps
December 2013
March 2013

Want to be notified about future Roundtables & other Sitecore events?