Font Awesome
Created by Orckestra
Technical Information
The add-on adds the FontAwesome files to the website at:
~/Frontend/Orckestra/Web/Html/FontAwesome/
It also adds a C# Inline function called "Orckestra.Web.Html.FontAwesome.GetIconNames".
How to use the GetIconNames function
The "Orckestra.Web.Html.FontAwesome.GetIconNames" function parses the font-awesome.css
and returns the list of font icon options.
It can be used in the "FontIconSelector" widget.
In a Razor function
Here is the example of using it in a Razor function:
Collapse codeprivate const string iconWidget = @" <f:widgetfunction xmlns:f=""http://www.composite.net/ns/function/1.0"" name=""Composite.Widgets.String.FontIconSelector""> <f:param name=""ClassNameOptions""> <f:function name=""Orckestra.Web.Html.FontAwesome.GetIconNames"" /> </f:param> <f:param name=""StylesheetPath"" value=""~/Frontend/Orckestra/Web/Html/FontAwesome/css/font-awesome.css"" /> <f:param name=""ClassNamePrefix"" value=""fa fa-"" /> </f:widgetfunction>"; [FunctionParameter(Label = "Icon", WidgetMarkup = iconWidget)] public string Icon { get; set; }
In a data type
You can also use it on a string field of a data type:
- Add a field in a data type.
- Field type: String
- String maximum length: Unlimited
- Change the widget type to
Composite.Widgets.String.FontIconSelector
. - Set the widget parameters:
- Class Name Options: Use the function
Orckestra.Web.Html.FontAwesome.GetIconNames
. - Stylesheet Path:
~/Frontend/Orckestra/Web/Html/FontAwesome/css/font-awesome.css
- Class Name Prefix:
fa fa-
- Class Name Options: Use the function
- Save your changes.
Examples
Some other add-ons depend on the Font Awesome icons and require this add-on be pre-installed. For example, the "Orckestra.Web.Html.TeaserCards" add-on uses it in the FontIconSelector
widget on the "Icon" parameter in the "IconTeaser" function.
The starter sites also pre-install and use the Font Awesome add-on. For example, the "Top Links" feature on the "Venus" starter site makes use of the Font Awesome icons in the FontIconSelector
widget on the "Icon" field.