Data Type that enables you to use your own website icon set in the backoffice.
V7 Version will no longer be maintained.
Umbraco versions: 8.x.x
PM> Install Package BG.Icon.Picker.v8
Umbraco versions: 7.4.0-7.15.x
PM> Install Package BG.Icon.Picker
-
Install package through NuGet Package Manager
-
Create the data type
Location V8: Settings > Data Types > BG: Icon Picker
Location V7: Developer > Data Types > BG: Icon Picker
-
Configure the newly created data type.
-
Use and enjoy.
-
Install the package
-
Configure the data type
Location V8: Settings > Data Types > BG: Icon Picker
Location V7: Developer > Data Types > BG: Icon Picker
Path to stylesheet: Stand-alone stylesheet for the icons is required.
/css/icons.min.css
Class name regex: It's recommended to not use "icon" as class identifier so it won't interfere with the umbraco icons.
(icn-[^:]*?):before
The icon picker returns a string with the icon name so it's really simple to work with.
<i class="@(Model.Value<string>("icon"))"></i>
<i class="@(Model.Content.GetPropertyValue<string>("icon"))"></i>
Matthew-wise wrote up a converter for ModelsBuilder.
[PropertyValueType(typeof(string))]
public class BgIconPickerValueConverter : PropertyValueConverterBase
{
public override bool IsConverter(PublishedPropertyType propertyType)
{
return propertyType.PropertyEditorAlias.Equals("bgIconPicker");
}
}