Deactivating or updating the (core) jQuery module?

Topics: Core, Customizing Orchard, General, Troubleshooting, Writing modules
Apr 23, 2015 at 1:40 PM
I am running Orchard that comes with the Orchard.jQuery core module. The jQuery version in that module is 1.9.1. For some of the scripts on the website I need a more recent version of jQuery so I include 2.1.0 using the following line in the Layout.cshtml file of my theme:
This does work just fine, however Orchard forces jQuery 1.9.1 into the site. The following two lines of code are inserted just before the scripts from my Layout file that use .AtFoot() are called:
<script src="/web/Modules/Orchard.jQuery/scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="/web/Core/Shapes/scripts/base.js" type="text/javascript"></script>
To me it looks like the Orchard.jQuery module forces this script inclusion, but so far I have been unable to track down the exact point where it happens.

I do not need 1.9.1, my scripts work fine with (and sometimes requite) the 2.1.0 that I include manually.

How can I prevent Orchard from including this old jQuery version in my Theme?
Apr 28, 2015 at 4:30 PM
Edited Apr 28, 2015 at 4:30 PM
That depends on the theme you are using. The Orchard.jQuery module doesn't add the jQuery script to any pages. Instead it holds the script file and creates a ResourceManifest class based on the IResourceManifestProvider so jQuery can be included in views using: Script.Require("jQuery"); TheThemeMachine doesn't (to my knowledge) include jQuery. Terra on the other hand includes it's own version of jQuery in the Layout.cshtml file on lines 30-33. This is probably the method you would want to use. You will need to find where in your theme the old version of jQuery is getting included and then either remove that bit of code or change it to use the version of jQuery you need. Hope this helps.