Why does c5 load jQuery by default?
Permalink
Can anyone tell me why c5 loads jQuery on every page by default? And, why this functionality is not easily disabled? It seems that there should be a checkbox somewhere...
It's loaded on the front-end because many core blocks use it, and at the time we didn't have a good way to autoload scripts only when they were necessary. This changed quite some time ago, but due to backward compatibility we couldn't really remove it.
Like ollie mentions, it is pretty easy to get rid of, however. A special developer config makes sense, though.
Like ollie mentions, it is pretty easy to get rid of, however. A special developer config makes sense, though.
+1 to the developer configuration setting. That's a good idea.
We had some discussion about developer settings for jQuery via CDN a while backhttp://www.concrete5.org/community/forums/customizing_c5/fallback-f...
This looks like it should be an option within such a mechanism.
This looks like it should be an option within such a mechanism.
Is there any way to load a more recent version of jQuery? (I add it in after the "Loader::element('header_required');", but then it would have problems in when logged into c5 for editing. I could change it somewhere in the back-end I'm sure, but will that cause conflicts?
Thanks
Thanks
A new version of jQuery is going to be released in 5.4.2, to be released later this week according to ChadStrat (can anyone on the core team confirm this?).
You can see the current version checked into GitHub (https://github.com/concrete5/concrete5... )
You can see the current version checked into GitHub (https://github.com/concrete5/concrete5... )
I am not certain of the release date but I believe it will be this month.
Mike
(not a core team member)
Mike
(not a core team member)
If you don't want to wait for the next version of C5, there's a very easy way to include an updated version: change the name of your updated jquery file to just "jquery.js" (not jquery.142.min.js or whatever it might be), and drop it in your site's top-level "js" directory. C5 will pick that up automatically and use it instead of its own.
Question:
I did as you suggested and put jquery.js into the js directory. It is the same version of jquery that is compressed and minified into my bootstrap.js file. Whenever I am in Edit Mode, there is still a conflict happening. My dropdowns for some reason go all the way to the back. I think it might be due to C5 being greedy with .container classes and bringing them up to a higher z-index with jQuery. But, I also have just a basic conflict because when I click "Versions" from the Edit button on the top left, rather than a modal popping up, the whole screen turns white and the styles are all messed up.
I did as you suggested and put jquery.js into the js directory. It is the same version of jquery that is compressed and minified into my bootstrap.js file. Whenever I am in Edit Mode, there is still a conflict happening. My dropdowns for some reason go all the way to the back. I think it might be due to C5 being greedy with .container classes and bringing them up to a higher z-index with jQuery. But, I also have just a basic conflict because when I click "Versions" from the Edit button on the top left, rather than a modal popping up, the whole screen turns white and the styles are all messed up.
Sorry, I have no idea. It's possible the jquery override doesn't work anymore since they started combining all the system js together into 1 file (my original answer is from 2011, which was probably Concrete version 5.4, so a lot has changed since then... not sure though).
http://www.concrete5.org/documentation/how-tos/developers/five-easy...