• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc
Show / Hide Table of Contents

CSSInclude Theme Object Introduction

DNN Version: 09.02.00
10/02/2024 • 2 minutes to read
Contributors  Timo-Breumelhof
10/02/2024  • 2 minutes to read  • Contributors  Timo-Breumelhof

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" />
Theme ObjectsAbout ThemesCreating Themes
Back to top by the community, for the community... #DNNCMS