CSSInclude Theme Object Introduction
DNN Version: 09.02.00
• 2 minutes to read
• 2 minutes to read
Load a Custom Stylesheet for your Theme
Current Version: 01.00.00
Note
Please note that DNN automatically loads the following Style Sheets if they exist: From the Skin / Layout folder: Skin.css & "SkinName".css (same name as the ascx file). From the Container folder: Container.css & "ContainerName".css (same name as the ascx file). Although the loading specific CSS files for a Layout or a Container seems like a great option, in general adding a class to the Theme of Container and referencing that from your Skin.css if more efficient and easier to manage
Note
FYI, you must provide FilePath or DNN will throw an error
Include in Theme
ASCX
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<dnn:DnnCssInclude runat="server" FilePath="style.css" />
HTML Token
HTML Object Token
Attribute | Description | Default | Posssible Values | DNN Version |
---|---|---|---|---|
FilePath | Path to the CSS file to load | 01.00.00 | ||
PathNameAlias | Base Location of the CSS file to load | SkinPath SharedScripts |
01.00.00 | |
Priority | With this value you can set the relative order of the loaded Style Sheet. Where 100 is after Portal.css (which is prio 35) | 100 | DefaultCss: 5 ModuleCss: 10 SkinCss: 15 SpecificSkinCss: 20 ContainerCss: 25 SpecificContainerCss: 30 PortalCss: 35 Default value: 100 |
01.00.00 |
Examples:
Load Blue Style Sheet
<dnn:DnnCssInclude runat="server" FilePath="custom/css/blue.css" PathNameAlias="SkinPath" />