ML Checkbox List
The ML Checkbox List is designed for multi-selection scenarios. It allows users to pick multiple values from a predefined list, which are then synchronized as a delimited string.
⚙️ Configuration
Configure the editor in the Umbraco Data Type settings in the following order:
- Selection Mode: Choose how you want to provide your data:
- Items: Use the standard Umbraco "Dropdown" input configuration.
- Simple: Enter a list of values, one per line (e.g., EN, DE, FR).
- Enum: Enter the fully qualified name of your Enum including the namespace (e.g., MyProject.Models.Countries).
- Translation Prefix: Add a prefix (e.g., Country.) to automatically look up translations in the Umbraco Dictionary.
- Sort Alphabetically: If enabled, the checkboxes will be sorted A-Z based on their display labels (translated names) rather than the source order.
- Display Inline: If enabled, the checkboxes are shown side-by-side in a flexible row instead of a vertical stack.
- Display as Tags: If enabled, the selected values are rendered as modern UI tags in the Umbraco Backoffice for a more compact and visual representation.
💻 C# Data Retrieval (Value Converter)
When retrieving values in your code, the Umbraco-Suite provides a built-in Value Converter that automatically handles the multi-select logic:
// Retrieve multiple selections as an enumerable
var content = Umbraco.Content("your-node-guid");
var selectedItems = content?.Value<IEnumerable<string>>("myCheckboxList");
// Example Result: ["EN", "DE"]
// Example: Check if a specific key is selected
if (selectedItems != null && selectedItems.Contains("DE"))
{
// Do something specific for Germany
}
✅ Validation
The ML Checkbox List fully integrates with the Umbraco validation system:
- Supports the native Mandatory toggle. At least one checkbox must be checked to pass validation.
- Displays the Custom Mandatory Message defined in your Data Type settings.
📝 Storage Note
In the database, the value is stored as a semicolon-separated string (e.g., EN;DE;FR). The Value Converter automatically splits this string into an IEnumerable<string> for you.