Sitecore Single-line Text Field with suggestions and autocomplete features
-
Create class which inherits from SmartSitecore.AutoCompleteTextField.Fields.AutoCompleteText and implement GetServiceUrl method:
- It should return url to ajax web method like
"/api/sitecore/StylesAutoComplete/Load"
. - This method can be created elsewhere as WebMethod or MVC GET and should return list of string as json object, like:
For details check jQuery-Autocomplete
{ "suggestions": [ { "value": "UK", "data": "UK" }, { "value": "US", "data": "US" } ] }
- It should return url to ajax web method like
-
Create new field type in Sitecore core database under
/sitecore/system/Field types
, pointing to your class and assembly, use new field in your templates. -
For sample usage visit Css Picker Project
-
Check out blog entry for details.