Custom Pipeline to Resolve Items In a Bucket

Sometimes you need to use a bucket in Sitecore to handle several items. This really depends on the specifications or needs you have, but a general rule is to use buckets when you plan to have several products, media files, etc. In case you need more information about buckets, you can visit the Sitecore documentation about it.

The way we handle or interact with items in buckets is through code since we need to use Sitecore search, or your indexer provider like Lucene, SOLR, Coveo, etc.

First, let’s suppose we have the following bucket in Sitecore:

View bucket items

Here is a snippet of the custom pipeline to search for an item in Sitecore. The idea was to make it easy to read and understand that’s why you see few lines. But you can find here the whole file with all code and functions.

Custom Item Resolver Pipeline

The second part consists in registering a route in the RouteConfig file. This is recommended because it provides a cleaner URL to the end user as well as it is flexible to handle more routes.

RouteConfig-CustomItemResolver

Now, we are completed and have everything we need since The last part, routes, can now met the first step in the custom pipeline. Remember that all details of the pipeline is available to be downloaded here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.