Hello, I'm following this article to associate a CSS file with its corresponding custom Web User Control but it's not loading the CSS and I think it's because they need to be within the scope of a Theme/Skin directory? see screenshot.
https://docs.dnncommunity...reate-css/index.html
Thank you!
Well, yes and no. In the context of the Theme there are some fiels that are loaded "by convention". Or for a module if the file is named module.css For all other css files you should use the Client Resource manager to load them: https://docs.dnncommunity.org/content/tutorials/client-resources/index.html
I believe you are looking for #5. Rename the file to module.css and move it up one directory. The module.css is not isolated to just one Web User Control, it will load on all user controls within the module. I've had trouble in the past doing this after a module is already installed and sometimes takes removing the module from the Extensions and re-adding it to see the module.css file. I don't believe there is isolation to just one control unless you specifically load the .css file by name.
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %> <dnn:DnnCssInclude id="cssHomePublic" runat="server" filepath="~/DesktopModules/CVContent/HomePublic/HomePublic.css" />
Happy DNNing
yes, it was #5 but I didn't catch that when reading, I thought I still had to specify the full path and so on, I'm looking for automation so, module.css it is... thank you
Ryan's reply will work too, but it's more work to do and maintain. You should always use the module.css, unless you have a good reason not too. It just works and all you have to do is be sure the file is in the correct place with the expected name. Done, and done! 😎
Yes, that's what I had working but I like module.css better... thank you
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.