Hello, I see that under Pages --> Advanced --> Appearance: Page Stylesheet I can provide the relative path to my external CSS file and the system automatically adds the file versioning, which is great
How do I add my own GLOBAL css files such as ?
I don't want to use the Settings --> Custom CSS because that will grow into one huge CSS file.
I have the website open in VS 2022 and my Page-specific .css files are working as expected. I'm just trying to figure out the GLOBAL css files, which I want to use to split up my styles.
Thank you!
The only global files you'll find in DNN are ones that you shouldn't be touching, such as Default.css.
Also, you're correct that you should be avoiding the Portal.css whenever possible. That's mainly meant as a last resort place to manage CSS fixes that you can't/won't put into the theme. It's also the last stylesheet, so it's helpful to override things that a rogue module might be doing to your website.
I have good news for you, though...
If you're running DNN, you also have a theme installed and in use. This is the place that you should be including and managing any global styles for the website. However, what the file name is will only be known to you. Often, it may be called skin.css, but it could be named anything.
You'll find the theme in one of the following locations:
[themename]
[XX]
[XX] == The PortalID of the site, usually starting at zero (0).
I hope this helps! 😎
hhhhmm ok now I'm a bit confused though... I am working with a paid Skin (see below) and changing its settings through its ThemePlugin GUI.
I am also creating brand new HTML directly in DNN and custom C# Controllers (Extensions) in VS.
How do I add my own global CSS and JS where DNN will automatically manage its versioning suffix (?cdv=75)? and, what about adding them WITHOUT the suffix (?cdv=75)?
There are many ways you can so this, but when you simply add a "skin.css" file to your theme root folder, DNN will automatically load it (you might have te restart DNN after adding it). When you want to load custom files (css or JS), you can use the built in Client Resource mamangement, which will add the version QS parameter for you:
https://docs.dnncommunity...resources/index.html
You can use this in both a Theme and a custom extension
Style sheets in DNN: https://docs.dnncommunity...reate-css/index.html
I'm not very familiar with that specific commercial theme, but the theme plugins like the one you mention usually have a way for you to work on the CSS. If it's not obvious, I'd suggest sending them a support request.
However, commercial themes that try to be "everything to everyone" will by default have a bunch of bloat (because it has to). This is likely the reason why you're trying to break things apart. It will have better performance and perceived performance improvements by scanning tools.
Keeping that mind... you may not be able to fully do what you really want to do, except by getting a custom theme built that only contains the features you need.
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.