- Drop the contents of this folder into the "App_Plugins" folder of an Umbraco V7 instance.
- Locate the "Developer" section in the Umbraco backoffice.
- Create a new data type of type "JSON Drop Down List".
- Point the request URL to your desired JSON file or Web API request
- Assign the data type to a document type in the "Settings" section of the Umbraco backoffice.
- Bask in the win that is property editors are in Umbraco v7
The demo comes with a JSON file with countries in it. If you're looking for an example of an Umbraco Web API controller. Check out this gist.
For a standard Umbraco installation, this would live at /umbraco/JsonDropDownList/JsonDropDownListApi/[method_name]
This is a very rough and ready demo showing off a property editor with prevalues.
Were this more than a demo, I would (and probably will and some point) improve the following:
- Validation of the model.value so that if it doesn't exist in the list, it gets selected to the first value
- Add an optional "default value" (eg. "Please select") as a prevalue
- Expand this collection to support radio button & checkbox groups
If you have any questions regards this demo, give me a shout on twitter @jamiepollock.