AndrewK.Umbraco.Dropdown
16.0.2
dotnet add package AndrewK.Umbraco.Dropdown --version 16.0.2
NuGet\Install-Package AndrewK.Umbraco.Dropdown -Version 16.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AndrewK.Umbraco.Dropdown" Version="16.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AndrewK.Umbraco.Dropdown" Version="16.0.2" />
<PackageReference Include="AndrewK.Umbraco.Dropdown" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AndrewK.Umbraco.Dropdown --version 16.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AndrewK.Umbraco.Dropdown, 16.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AndrewK.Umbraco.Dropdown@16.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AndrewK.Umbraco.Dropdown&version=16.0.2
#tool nuget:?package=AndrewK.Umbraco.Dropdown&version=16.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AndrewK.Umbraco.Dropdown
AndrewK.Umbraco.Dropdown is a custom property editor for Umbraco 16 that enhances the default dropdown functionality with advanced features and improved user experience. It provides a flexible and intuitive dropdown interface for selecting single or multiple values within the Umbraco backoffice.
Features
- Single or Multiple Selection: Configure as a single-select dropdown or a multi-select list.
- Default Value Support: Set default values for new content items.
- Legacy Value Handling: Gracefully handles values that no longer exist in the options list.
- Validation Support: Provides visual feedback for invalid selections.
- Responsive UI: Modern interface built with Lit elements.
- Type-Safe Access: Returns string for single selection or IEnumerable<string> for multiple selections.
- Umbraco 16 Compatible: Built specifically for Umbraco 16 using modern web standards.
Installation
You can install the package via NuGet:
dotnet add package AndrewK.Umbraco.Dropdown
Usage
Creating a Dropdown Property
- Create a new Data Type in the Umbraco backoffice
- Select "AndrewK Dropdown" as the property editor
- Configure options and selection mode
- Add the data type to your document type
Configuration Options
- Items: Define the dropdown options as key-value pairs
- Multiple: Toggle between single and multiple selection modes
- Default: Set a default value for new content items
Accessing Dropdown Data in Controllers/Services/Templates
public class MyController : Controller
{
public IActionResult Index()
{
var content = // ... get your content
// For single selection
var singleValue = content.Value<string>("mySingleDropdownProperty");
// For multiple selection
var multipleValues = content.Value<ICollection<string>>("myMultiDropdownProperty");
foreach (var value in multipleValues ?? Enumerable.Empty<string>())
{
// Process your values
}
return View();
}
}
Example Of Setting Dropdown Data in Controllers/Services
public class MyController : Controller
{
public IActionResult Index()
{
var collection = // ... your collection, serializable to a list of strings
// set serialized object
content.SetValue(PropertyAlias, JsonConvert.SerializeObject(collection));
return View();
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- AndrewK.Umbraco.Dictionary (>= 16.0.2)
- Microsoft.AspNetCore.Components.Web (>= 9.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
16.0.2:
- Dependencies-versions update.