Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable or remove the default.css, skin.css and portal.css in DNN for normal Users

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..

like image 420
murli2308 Avatar asked Oct 19 '25 09:10

murli2308


2 Answers

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>
like image 119
ravi chandra Avatar answered Oct 21 '25 22:10

ravi chandra


<%@ 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)

like image 33
Daming Zhang Avatar answered Oct 21 '25 22:10

Daming Zhang