I have created the Project using DNN. I have written my CSS code in say "main.css". Firstly, I have created the HTML of the Project and then I have integrated it with DNN.
Now, the DNN default.css, skin.css and portal.css is overriding the main.css. I need a way to that when I am logging in through admin then only "default.css, skin.css and portal.css" this CSS should get applied. Otherwise for Normal users it should not get applied..
Simple flow of css to add
Admin User - default.css, skin.css , portal.css and main.css
Normal User - main.css
Hope My question is understandable..
disable or remove the default.css, skin.css and portal.css in DNN for normal Users
For DNN 7 :- Disable/Remove unwanted (default) css files to be loaded in DotNetNuke (DNN)
For DNN 8:-
<script type="text/javascript">
$(document).ready(function () {
if ($('#ControlBar_ControlPanel').length == 0) {
$('head link[href*="/Resources/Shared/stylesheets/dnndefault/7.0.0/default.css"]').remove();
$('head link[href*="/Resources/Shared/stylesheets/dnndefault/8.0.0/default.css"]').remove();
}
});
</script>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<dnn:DnnCssExclude runat="server" Name="dnndefault" />
Put those above in the page template file, like home.ascx, index.ascx. It will remove default.css, can I ask you why are you going to remove it? it will cause an issue when you are trying to add a new module and you probably are not able to drag the module in the admin mode (I'm using DNN9.8)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With