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?
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.
/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:
© 2022 - 2024 — McMap. All rights reserved.