Combined CSS from Sitefinity handler is overwriting my CSS
I am in the process of moving my website from one server to another. I did a straight backup of the files and database and restored them on the new server. The new site is getting additional CSS rendered added by Sitefinity and I am having trouble figuring out A) why? and, B) how to remove it? It looks like the new site is making an extra HTTP request that wasnt on the original site.
/Telerik.Web.UI.WebResource.axd?compress=0&_TSM_CombinedScripts_=%3b%3bTelerik.Sitefinity.Resources%2c+Version%3d5.0.2500.0%2c+Culture%3dneutral%2c+PublicKeyToken%3dnull%3aen%3a3b8a03be-7bcd-43f5-95b2-1208560bbefc%3ad271177c%3adff30785
Where did this come from? How can I prevent to from rendering?
Sitefinity 5.0.2500.0
Hey Jeff,
A shot in the dark without knowing more but:
- Have you verified your theme and template are available and working correctly?
- Did you forget to turn off in-line editing?
- Have you added or changed a RadControl on your page?
If I'm not mistaking the webresource you're talking about is the one that loads Sitefinity's basic layouts, but without knowing for sure its just a guess and can't really give you an answer on B)...
Jochem
Thanks Jochem. I just disabled inline editing and that didn't remove the CSS file. I'll give the other two a shot next but I think it might take a little longer to chase down those answers. In the meantime, I think youre right about it being related to the basic layout. The CSS file has two sections bracketed by comments. Those comments are...
/* START Telerik.Sitefinity.Resources.Themes.Basic.Global.Reset.css */
-and-
/* START Telerik.Sitefinity.Resources.Themes.Basic.Global.Layout.css */
Edit your page template, top right there's a "Theme" button. click that then change from "Basic" to your theme...?
STEVE! You're the best. That was the issue. I dont know how each of the Page Templates got set with the Basic template but resetting everything to -no theme- did the trick.
Hi Jeff,
Just to clarify that the basic theme contains some styles that might not overwrite the ones you're loading, but will be loaded on the page, and this is probably the reason why you're getting the additional css response.
Regards,Thanks a lot Steve.
It did the trick.
Hi,
I am having the same issue. But from the Edit view of page template i am not able to click on the theme or layout button. It gives no response. Publish button is also not working .I am having some jquery files and script files added in the template. Will that be causing the issue .
Thanks!
Anju
Hi Anju,
It seems that some of the scripts you load on the problematic page template cause the conflict. What I can suggest is to try to remove the scripts you load one by one in order to determine which one causes the issue.
Based on our experience these type of errors may occur if you load two different versions of jQuery on the page. Please note that in Sitefinity version 8.0 we use the built-in jQuery library version 1.11.2 and we highly recommend that you use the same version if your current Sitefinity version is 8.0. This way you will avoid any script conflicts.
You can check the scripts which are loaded in your project and their versions under Administration -> Settings -> Advanced -> Pages -> Script Manager -> Script references.
The best approach is to use the ResourceLinks control as shown below in order to ensure will ensure that the built-in jQuery library is loaded on your page or page template:
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<
sf:ResourceLinks
ID
=
"resourcesLinks"
runat
=
"server"
>
<
sf:ResourceFile
JavaScript
Library
=
"JQuery"
/>
</
sf:ResourceLinks
>
I am having the html for the page template within the master page in sitefinity. And i have added script as mention in the reply. But now also my script is not loading.
I get error in browser console :
Uncaught Error: Bootstrap's JavaScript requires jQuery
custom.js:2 Uncaught ReferenceError: $ is not defined
social-responsibility:318 Uncaught TypeError: undefined is not a function
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<body class="main-body">
<form id="form1" runat="server">
<sf:ResourceLinks ID="resourcesLinks" runat="server">
<sf:ResourceFile JavaScriptLibrary="JQuery" />
<sf:ResourceFile Name="~/js/bootstrap.js" Static="true" />
<sf:ResourceFile Name="~/js/custom.js" Static="true" />
</sf:ResourceLinks>
<script type="text/javascript">
var jq14 = jQuery.noConflict(true);
</script>
</form>
</body>
What is going wrong document.ready in my user controls are also not working.Please help.
Hi Anju,
The problem could be that your libraries are being loaded before JQuery - loading scripts coming from relative paths, then scripts from embedded resources, and then from CDN.
So you could try to embed your libraries and request them from embedded paths as described here:
http://docs.sitefinity.com/for-developers-add-javascript-resources
In that case please check and ensure that :
- You have 'fake' Program.cs file in the root folder of your external library (the Program name refers to "AssemblyInfo="ExternalResources.Program, ExternalResources"".
- The .js file/s is/are set as Embedded resource
- The reference to that external library (or the dll is copied in the SitefinityWebApp project and is referenced)
I hope the information above was useful.
Regards,
Svetoslav Manchev
Telerik