Disabling Embedded Resources for RadMenu|Navigation in Sitef

Posted by Community Admin on 05-Aug-2018 09:37

Disabling Embedded Resources for RadMenu|Navigation in Sitefinity 4.x

All Replies

Posted by Community Admin on 20-Jan-2012 00:00

I spent quite a bit of time trying to figure out how to stop the navigation control from rendering the embedded CSS files that were causing havoc with my design. After much searching, reading, trials, etc. I discovered a few things that I hope will save someone else some time:

1. Mapping a custom template to the navigation widget and setting the EnableEmbeddedSkins and EnableEmbeddedBaseStylesheet to false does NOT produce the results you would think. For some reason the stylesheets are still pushed out to the site

2. To remove the stylesheets properly add the following lines to your web.config file:

1.<!-- Disables the embedded skins for Navigation instances -->
2.<add key="Telerik.Navigation.EnableEmbeddedSkins" value="false"/>
3.<add key="Telerik.Navigation.EnableEmbeddedBaseStylesheet" value="false"/>

I tested this and confirmed that it does remove the stylesheets for the Navigation control.

Note: If you follow the advice given on the following URL: www.telerik.com/.../introduction-disabling-embedded-resources.html the result will be that the Sitefinity back end menus (even context menus) will be broken.

Perhaps someone has experienced something similar and has a better way to achieve this through the widget template mapping?

Jacques

Posted by Community Admin on 21-Jan-2012 00:00

And the stylesheets are back! Sorry guys, not sure what happened, but for the briefest of moments the stylesheets were in fact gone, but now they're back again. I checked and the 2 app settings are still present as in :

<add key="Telerik.Navigation.EnableEmbeddedSkins" value="false" />
<add key="Telerik.Navigation.EnableEmbeddedBaseStylesheet" value="false" />

I ran into a System Out of Memory exception yesterday so I was dealing with that, but I'm not sure if I inadvertently did something to cause the stylesheets to appear again.

Hoping someone out there has a definitive answer for this.

Regards,
Jacques

Posted by Community Admin on 21-Jan-2012 00:00

Hi Jacques,

Actually, disabling embedded scripts, in order to remove part of them, isn't a good idea, because then you'd have to add the disabled JavaScript resources from an external location. Please review this article in the RadControls documentation: http://www.telerik.com/help/aspnet-ajax/introduction-disabling-embedded-resources.html. If you disable the base scripts and you do not provide them manually you risk breaking the controls and all the client side functionality of this page, which is what happened in your case. It does not seem reasonable making customers add the scripts by themselves. However, if you decide to disable scripts and styles anyway, I would advise you to use the RadControls and create an external template for your Navigation. You can create a RadRabStrip, RadMenu, PanelBar, RadTreeView navigations set and configure in their declarations EnableEmbeddedSkins and EnableEmbeddedScripts to false and add all requires scripts manually, as shown in the above article.

Regards,
Boyan Barnev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 23-Jan-2012 00:00

Hi Boyan,

I'm not sure if you noticed, but I only disabled the embedded skins and stylesheets, not the scripts, even though the article that you included a link for suggests doing that.

That however is not the problem I'm experiencing. The scripts I want in, but I don't want Telerik's styling (CSS) to be loaded.

Also you mention "...configure in their declarations EnableEmbeddedSkin..."... this doesn't work. You have to do it in the web.config, but even then it's not consistent.

Regards,
Jacques

Posted by Community Admin on 25-Jan-2012 00:00

Hi  Jacques,

Thank you for getting back to me.  Actually if you create an external template and explicitly set

EnableEmbeddedScripts to false and also apply your custom skin where you've declared custom styles, the default ones should not load. For example on creating custom skin for the Navigation widget in Sitefinity please check this article.


 
Greetings,
Boyan Barnev
the Telerik team
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
 

This thread is closed