TabStrip and RibbonBar CSS Files Cannot Be Removed

Oct 20, 2010 at 8:58 PM
Edited Oct 20, 2010 at 8:59 PM

Again, I love this module / skinobject!

However, I can't seem to get it to remove the following CSS files:

/Portals/_default/Skins/_default/WebControlSkin/Default/TabStrip.Default.css

 /Portals/_default/Skins/_default/WebControlSkin/Default/RibbonBar/RibbonBar.Default.css 

 /Portals/_default/Skins/_default/WebControlSkin/Default/RibbonBar/TabStrip.Default.css

I did a test removing all the CSS files using RemoveCssFile="/" and only those were still left. Unfortunately, they are the files I want to suppress (related to my previous post here - I want them only to load for Admins/Editors.

Any ideas?


 


Coordinator
Oct 21, 2010 at 9:52 PM

Yes, I see. I guess these files are added in a different way. I'll look at fixing that next week (I'm very busy ATM)

Coordinator
Oct 21, 2010 at 10:24 PM

01.06.00 released, supports removing of the ribbon bar CSS. (not the telerik CSS files)

Oct 22, 2010 at 11:13 AM

Thanks for the quick turn around! 

I'll give the new version a try today.

 

 

 

Oct 22, 2010 at 1:25 PM
Edited Oct 22, 2010 at 1:28 PM

I installed the new module, but it throws an error when I add any files for removal:

 

DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at FortyFingers.Dnn.SkinObjects.StyleHelper.UnloadCss(String sFileName) at FortyFingers.Dnn.SkinObjects.StyleHelper.ProcessRemoveFiles() at FortyFingers.Dnn.SkinObjects.StyleHelper.Page_PreRender(Object sender, EventArgs e) at System.Web.UI.Control.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

Here is how the objects are referenced in the skin:

 

<%@ Register TagPrefix="fortyfingers" TagName="STYLEHELPER" Src="~/DesktopModules/40Fingers/SkinObjects/StyleHelper/StyleHelper.ascx" %> 

<fortyfingers:STYLEHELPER ID="STYLEHELPER1" BodyClass="[BcId]" runat=server />

<fortyfingers:STYLEHELPER ID="STYLERHELPER2" RemoveCssFile="default.css" runat=server />

 

Coordinator
Oct 22, 2010 at 7:52 PM

You forgot the "" around the "server"

<fortyfingers:STYLEHELPER ID="STYLEHELPER1" BodyClass="[BcId]" runat="server" />

<fortyfingers:STYLEHELPER ID="STYLEHELPER2" RemoveCssFile="default.css" runat="server" />

works for me...

Coordinator
Oct 22, 2010 at 7:58 PM

BTW, I updated to 01.06.01 too..

Oct 22, 2010 at 8:02 PM

Weird. It was working before without the quotes. I'll update it and test again.

Thanks.

 

Oct 22, 2010 at 8:13 PM
Edited Oct 22, 2010 at 8:31 PM

On DNN PRO 05.05.01 (22), I Added the quotes, and I am still getting the error - not sure if "PRO" is causing the problem

I tested the latest module on DNN 05.04.04 (2) community and it works fine.

<%@ Register TagPrefix="fortyfingers" TagName="STYLEHELPER" Src="~/DesktopModules/40Fingers/SkinObjects/StyleHelper/StyleHelper.ascx" %> 

<fortyfingers:STYLEHELPER ID="STYLEHELPER1" BodyClass="[BcId]" runat="server" />

<fortyfingers:STYLEHELPER ID="STYLERHELPER2" RemoveCssFile="default.css" runat="server" />

Note, the BodyClass is working fine on both PRO and Community. It is just RemoveCssFile that is not working on PRO.

 

 

Coordinator
Oct 22, 2010 at 8:15 PM

Did you install the DNN 4 or DNN 5?

Coordinator
Oct 22, 2010 at 8:26 PM

I tested you code in DNN 4 & DNN 5 and it works fine...

Strange..

Oct 22, 2010 at 8:32 PM

Sorry, I had a delayed reply in progress. Version 5 and it's the PRO version that freaks out when removing CSS files. Adding the body ID works fine.

Coordinator
Oct 22, 2010 at 8:53 PM

Ok, I didn't test in the Pro version...

Is there something logged in the Event viewer?

Oct 22, 2010 at 9:08 PM

Yep. Here you go:

 

InnerException: Object reference not set to an instance of an object.
FileName
FileLineNumber: 0
FileColumnNumber: 0
Method: FortyFingers.Dnn.SkinObjects.StyleHelper.UnloadCss
StackTrace
Message: DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at FortyFingers.Dnn.SkinObjects.StyleHelper.UnloadCss(String sFileName) at FortyFingers.Dnn.SkinObjects.StyleHelper.ProcessRemoveFiles() at FortyFingers.Dnn.SkinObjects.StyleHelper.Page_PreRender(Object sender, EventArgs e) at System.Web.UI.Control.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

Coordinator
Oct 22, 2010 at 9:29 PM

I'll test on pro next week and see if I can solve it

Oct 25, 2010 at 5:40 PM

Cool. Thanks!

Coordinator
Oct 25, 2010 at 10:00 PM

Hmm, I installed DNN pro 05.05.01 and the skin object seem to work as expected...

I added it to the DNN Pro skin:

----------------------------------------------------------------------------------------------------------------

<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
<%@ Register TagPrefix="dnn" TagName="LANGUAGE" Src="~/Admin/Skins/Language.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>
<%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>
<%@ Register TagPrefix="dnn" TagName="NAV" Src="~/Admin/Skins/Nav.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TEXT" Src="~/Admin/Skins/Text.ascx" %>
<%@ Register TagPrefix="dnn" TagName="BREADCRUMB" Src="~/Admin/Skins/BreadCrumb.ascx" %>
<%@ Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/User.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
<%@ Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
<%@ Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>
<%@ Register TagPrefix="dnn" TagName="STYLES" Src="~/Admin/Skins/Styles.ascx" %>
<%@ Register TagPrefix="fortyfingers" TagName="STYLEHELPER" Src="~/DesktopModules/40Fingers/SkinObjects/StyleHelper/StyleHelper.ascx" %>
<fortyfingers:STYLEHELPER ID="STYLEHELPER1" BodyClass="[BcId]" runat="server" />
<fortyfingers:STYLEHELPER ID="STYLERHELPER2" RemoveCssFile="/" runat="server" />

    <div id="s_wrap_main">
        <div id="s_wrap_sub">
            <div class="template_style">
            <div class="cpanel_left">
                <div class="cpanel_right">
                    <div runat="server" id="ControlPanel" ></div>
                </div>
            </div>
                <div class="top_space">
                    <div class="lang_pad">
                        <dnn:LANGUAGE runat="server" id="dnnLANGUAGE"  showMenu="False" showLinks="True" />
                    </div>
                </div>
                <div class="logo_top">
                    <div class="logo_top_left">
                        <div class="logo_top_right">
                            <div class="logo_top_bg">
                            </div>
                        </div>
                    </div>
                    <div class="logo_left">
                        <div class="logo_right">
                            <div class="logo_pad">
                                <dnn:LOGO runat="server" id="dnnLOGO"  />
                            </div>
                        </div>
                    </div>
                </div>
                <div class="menu_left">
                    <div class="menu_right">
                        <div class="menu_bg">
                            <div class="search_style">
                                <div class="search_bg">
                                    <dnn:SEARCH runat="server" id="dnnSEARCH"  CssClass="ServerSkinWidget" UseDropDownList="true" Submit="<img src=&quot;images/search.gif&quot; border=&quot;0&quot; alt=&quot;Search&quot; /&gt;" />
                                </div>
                            </div>
                            <div class="menu_style">
                                <dnn:NAV runat="server" id="dnnNAV"  ProviderName="DNNMenuNavigationProvider" IndicateChildren="false" ControlOrientation="Horizontal" CSSControl="mainMenu" />
                            </div>
                            <div class="clear_float">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="bread_left">
                    <div class="bread_right">
                        <div class="bread_bg">
                            <div id="bread_style">
                                <dnn:TEXT runat="server" id="dnnTEXT"  CssClass="breadcrumb_text" Text="You are here >" ResourceKey="Breadcrumb" />&nbsp;<span>
                                <dnn:BREADCRUMB runat="server" id="dnnBREADCRUMB"  CssClass="Breadcrumb" RootLevel="0" Separator="&nbsp;>&nbsp;" />
                                </span>
                            </div>
                            <div id="login_style" class="user">
                                <dnn:USER runat="server" id="dnnUSER"  CssClass="user" />
                                &nbsp;&nbsp;|&nbsp;&nbsp;<dnn:LOGIN runat="server" id="dnnLOGIN"  CssClass="user" />
                            </div>
                            <div class="clear_float">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="center_bg">
                    <div class="left_bg">
                        <div class="right_bg">
                            <div class="content_pad">
                                <div class="content_width">
                                    <div runat="server" id="TopPane"  class="TopPane" ></div>
                                    <table width="99%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td valign="top" id="LeftPane" class="LeftPane" runat="server">
                                            </td>
                                            <td valign="top" id="ContentPane" class="ContentPane" runat="server">
                                            </td>
                                            <td valign="top" id="RightPane" class="RightPane" runat="server">
                                            </td>
                                        </tr>
                                    </table>
                                    <div runat="server" id="BottomPane"  class="BottomPane" ></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="bot_left">
                    <div class="bot_right">
                        <div class="bot_bg">
                        </div>
                    </div>
                </div>
                <div class="bot_pad">
                    <div id="terms_style" class="footer">
                        <dnn:PRIVACY runat="server" id="dnnPRIVACY"  CssClass="footer" />
                        &nbsp;&nbsp;|&nbsp;&nbsp;<dnn:TERMS runat="server" id="dnnTERMS"  CssClass="footer" />
                    </div>
                    <div id="copy_style" class="footer">
                        <dnn:COPYRIGHT runat="server" id="dnnCOPYRIGHT"  CssClass="footer" />
                    </div>
                    <div class="clear_float">
                    </div>
                </div>
            </div>
        </div>
    </div>

Oct 26, 2010 at 5:58 PM

Timo, 

Thanks for taking a look. I found the problem. I updated to the new version at the same we made a minor, but apparently significant change to default.aspx: we removed the "id=head" from the <head> tag.

I dislike having an ID on the head tag, but it's just the way DNN works. 

Anyway, thanks for the great extension(s).

Coordinator
Oct 26, 2010 at 7:54 PM
Edited Oct 26, 2010 at 7:55 PM

Ah, ok. Then it's logical, the new version looks for the id="Head" and removes the stylesheets in it.

Other modules will expect the id too so removing it could also lead to other issues too.