Populate a Sitecore Droplist with static values
Asked Answered
S

2

10

Can I populate a droplist in sitecore with a list of values by directly specifying them in the source field like Apples|Oranges|Grapes and have them show-up on the template instead of actually creating items for each value and then writing a query pointing to the parent?

Stokeontrent answered 1/11, 2010 at 16:7 Comment(0)
Q
6

There is no default functionality for this. The typical approach would be to create a folder containing items with each of these names, and set that folder as the source of a standard droplist field. But I would use droplink instead of droplist, because then you have strong references by ID rather than weak references by name, and those references appear in the links database.

Alternatively, you could probably achieve this by overriding the droplist control.

Quits answered 2/11, 2010 at 15:50 Comment(0)
L
4

/sitecore/System/Dictionary might be a good home for the values you need to create in this context. Adding them to the Dictionary also makes them localizable and allows users to reference them as tokens in other fields if desired.

You might also find this article to be of interest. It goes into some detail about other uses for Dictionary items and Tokens.

Also, Sitecore's Reusing and Sharing Data guide has additional information on how to use Dictionary items and looks at other situations where you might want to inject simple values into items:

Librarianship answered 28/3, 2011 at 18:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.