Style Options from a File
Created by Orckestra
Default style options
The Orckestra.Web.Html.GetStyleOptionsFromFile function comes with the default style options:
- None
- White
- Light
- Gray
- Dark
- Primary
- Info
- Success
- Warning
- Danger
The options are defined in:
~/Frontend/Orckestra/Web/Html/GetStyleOptionsFromFile/BackgroundOptions.xml
By default, the Orckestra.Web.Html.GetStyleOptionsFromFile widget function's OptionsXMLFilePath parameter is set to the path above.
The respective style classes are defined in ~/Frontend/Orckestra/Web/Html/GetStyleOptionsFromFile/BackgroundOptions.css or in other stylesheets (normally, Bootstrap-related).
How to present style classes as a list of options on function parameters
Note. For the usage examples, please see the BackgroundStyle parameter of the Orckestra.Web.Html.ImageAndTextTeaser and Orckestra.Web.Html.StatementTeaser functions used on the Venus and Mercury starter sites.
- Define your style classes in stylesheets on the website.
Expand code - Create an XML file and map styles to user-friendly names for them.
Expand code- CssClassKey: The name of the class defined in a stylesheet.
- Label: The user friendly name for the class as a style option on the list.
- In the function where you want to use the style option list:
- define a parameter of the String type
- set its widget property to the Orckestra.Web.Html.GetStyleOptionsFromFile function
- set the widget function's OptionsXMLFilePath parameter to the path to your map file (Step 2 above)
Expand code
- Make sure that your function has the stylesheets where the styles are defined (Step 1 above) linked to from its content part.
Expand code