Guide to integrating jQuery into Sitefinity
I know with Drupal, there is a guide to integrating jQuery that shows you how to install Drupal plug-ins and even update to the latest version of jQuery for use with the CMS.
Is there a similar guide for integrating jQuery, jQuery UI, jQuery Mobile and various jQuery plugins into Sitefinity? If so, where can I find this guide or documentation?
Does the guide offer any best practices or patterns for integrating jQuery into Sitefinity CMS?
I need this as well. I'm wanting to include some jQuery plugins but they don't seem to work no matter where or how I try to include them. I've tried putting them in as ResourceLinks, in the script manager, loaded them through the javascript widget -- pasting in the code directly and then placing them in all different locations (in the head tag, where the widget is dropped, before the closing body tag) on the page, also trying the 'link to a javascript file' where you browse to pick the file -- even though i'm picking it directly it isn't even finding the file Plugins just don't seem to work. What is the process for integrating plugins?
Seems to work now with the JavaScriptEmbedControl Method
Hey Richard,
Just as a heads up regarding JavaScriptEmbedControl, if you have a .Master page which a code behind (and thus also a designer.cs) the use of JavaScriptEmbedControl causes VisualStudio to throw errors when trying to update the designer file.
Secondly. keep an eye out for proper capitalization, otherwise VisualStudio will interpret it as not a Sitefinity control but a regular .NET control with all subsequent errors...
Jochem
@Jochem
Just for fun, I put a contentplaceholder on my masterpage, in the header section, and then added my JavaScripEmbedControl references to it from the code behind... as I figured if I'm going to hard code it somewhere, programatic is as good as declaritive.
Seems to work ok, and puts the scripts where I wanted.
Now, if I could just get that pesky ResourceLinks/File thing to put things where I asked it to, I'd be a happy(ier) camper.
@MB,
At the moment I just 'extracted' the JavaScriptEmbedControl to a usercontrol so my designer plays nice at least. But haven't found a good work-around for the ResourceLinks.
Not using them, but load jQuery another way causes double loading, using them leaves you in the passenger seat with no render control. I even tried playing with the extracted Telerik.Resources scripts to see if that wouldn't trigger a double load but unsuccessful (as of yet).
Its a trade off between easy development vs optimum client experience I'm afraid.
Jochem
Thanks for the tip. I don't have a code behind file as of yet, but I'll keep that in mind for the future. Have you tried using the Kangaroo Add References Widget from the Marketplace?
Hey Richard,
Yes ofcourse :)
I constantly look for ways to improve and optimize and Peter certainly did a great job with his controls. I'm not going to use them however, I feel by doing things manually I still have better control but its a god-gift for power users who don't like messing with VisualStudio though.
Jochem.
Hey Jochem, I'm such a newbie that I'm not sure how to get the Kangaroo widget up and running. Could you give me a brief explanation of how to set it up?
Thanks!
I'm still looking for a reliable fool proof way to use Javascript Plugins. I didn't think it would be such a tricky process. I'm trying to use a Google Maps plugin and I can't for the life of me get it to work though in a standard HTML page it loads fine.
Hey Richard,
I've started writing up a blogpost on jQuery/Kangaroo/JS Widget and the chaos it seems to cause, although due to the schedule it probably be not until end of the week till its up, in the meantime (like I said in the other thread) feel free to spam me by email to get you up and running :)
Jochem