To Droplist or to Droplink in Sitecore XM Cloud, That Is the Question
A technical examination of Sitecore’s droplist and droplink fields—balancing performance, data integrity, and frontend complexity.
Start typing to search...
A technical examination of Sitecore’s droplist and droplink fields—balancing performance, data integrity, and frontend complexity.
Sitecore offers a variety of field types for content relationship management. Droplist and Droplink are two sorts of fields that are frequently utilized. Despite their apparent similarities, they have distinct benefits and drawbacks and are used for diverse purposes.
Let’s examine both, reviewing pros, cons as well as appropriate use cases of each. First, let’s look at the Droplink field.
A Droplink field creates a reference to another Sitecore item. The selected value is stored as an item ID rather than plain text, allowing for relationships between content items.
DroplinkField types. And likely won’t be, given the information provided within the reference data depends on the template of said item.While it is not a concern you should drop what you’re doing and rush to your XM Cloud instance right away, it is something to be thinking of when you’re building your taxonomy. Droplinks, like Multilist and other fields that, when a page published in XM Cloud generates its layout JSON, traverses the content tree. If by chance, in that traversal, a relationship points back to the page published it can create an circular generation. Thankfully XM Cloud has methods of detecting this, but if you have cases where pages are used in datasources, you need to run tests to ensure it’s not going to cause issues.
There are obviously certain circumstances where Droplinks are extremely valuable. Here are a few.
Let’s look at what may be required to utilize a Droplink field in a Next.js component. Since the field could contain any additional fields as part of the object reference, we have to manually create it.
import Link from 'next/link';
interface CategoryLinkProps {
fields: {
category?: {
value?: {
id: string;
name: string;
url?: string;
};
};
};
}
export const CategoryLink = ({ fields }: CategoryLinkProps): JSX.Element => {
const category = fields.category?.value;
if (!category) return <span className="text-gray-400">No Category Selected</span>;
return (
<Link href={category.url || '#'} className="category-link">
{category.name}
</Link>
);
};
A Droplist is a simple field in Sitecore where the user chooses a predetermined value from a list. The chosen value is saved in plain text format.
So what are some use cases where utilizing a Droplist field would be appropriate. Let’s have a look.
Ultimately it comes down to the fact if the values you are using are static, predefined, you don’t require additional information as part of the relationship and if you are largely using the values for things like labels, changes in UI, or styling.
Now let’s look into what a front-end component might look like if it uses a Droplist field.
interface PriorityLabelProps {
fields: {
priority?: {
value: string;
};
};
}
export const PriorityLabel = ({ fields }: PriorityLabelProps): JSX.Element => {
const priority = fields.priority?.value || 'Not Set';
return (
<span className={`priority-label priority-${priority.toLowerCase().replace(/\s/g, '-')}`}>
{priority}
</span>
);
};
| Feature | Droplist | Droplink |
|---|---|---|
| Stored Value Type | Plain text (e.g. “high”) | Object reference (e.g. {id, name, url}) |
| API Query Complexity | No queries needed | May require additional queries |
| Flexibility | Static, predefined values | Dynamic, can reference changing content |
| Multilingual Support | Limited | Fully supported via Sitecore item versions |
| Performance | Fast, direct value access | Potentially slower if extra queries on the front-end are required |
Proper usage is key to ensuring your front-end application performs as best as possible. Reducing the size of the layout JSON, which could contain all fields within a Droplink’s reference, may be overkill, and you could be impacting the performance of your site so it’s good to understand if it maybe better served as a Droplist field instead.