Top Tips Tuesday – How to use custom code data source to show Sitecore multilist

top sitecore tips

Have you ever had to  show items in a list dynamically based on its parent?

Case:

The case was to map the department with it’s company, so we needed to put the path of the company on the parent of the department.

Currently we’ve been using Multi list with search  however, have found it’s better to use a custom data source as the query as fast query didn’t work for this case.

How?

Using the “code” Data source  was the best solution for this case.

Below is an example of how we implemented this:

Code:

Firstly, you have to add reference for Sitecore.Bucket.dll as we will implement IDatasource interface

 

Sitecore multicast using data source

CMS:

In the source of your Multi list field put it in the below format:
code:”your class namespace with method”, “dll name”

 

CMS for Sitecore multilist using code data source[

For more tips and tricks

Talk to a Sitecore expert

Post a comment

Your email address will not be published. Required fields are marked *