jQuery conflicts. Can I just upgrade C5's jQuery?
Permalink
I'm using a new Bootstrap with jQuery v1.10.2 and Concrete5 is only on 1.7.2.
When in Edit mode, the conflict makes my blocks un-editable. If I remove the bootstrap jquery, it works fine, so I know it is a conflict that is causing the problem.
Is it possible to just upgrade C5's jquery to the newer version? Or is it possible to load one or the other depending on if the site is in Edit mode? How to go about either solution?
Found a solution to just load bootstrap.js (including newer jQuery if not in edit mode):
When in Edit mode, the conflict makes my blocks un-editable. If I remove the bootstrap jquery, it works fine, so I know it is a conflict that is causing the problem.
Is it possible to just upgrade C5's jquery to the newer version? Or is it possible to load one or the other depending on if the site is in Edit mode? How to go about either solution?
Found a solution to just load bootstrap.js (including newer jQuery if not in edit mode):
<?php // bootstrap jQuery 1.10.2 conflicts with Concrete5's 1.7.2, so we only load bootstrap.js if not in Edit mode $page = Page::getCurrentPage(); if(!$page->isEditMode()) { ?> <script src="<?php echo $this->getThemePath(); ?>/_/js/bootstrap.js"></script> <?php } ?>
I suggest simply upgrading the jquery version. However, keep in mind that it may (or may not) cause some problems with the interface or front-end design.
how would you do that? Just drop a new version in the concrete/js folder?
yes, make sure it has the same name as the one currently in there now.
what about all the other jquery files? It seems they would be dependent on the version of jquery.
If you want to experiment, you may find this pull request helps.
https://github.com/concrete5/concrete5/pull/771...
It got turned down, but is usable. You will need to update/re-base the changes to whatever c5 version you are running.
It allows you to re-map any assets by defining site constants.
https://github.com/concrete5/concrete5/pull/771...
It got turned down, but is usable. You will need to update/re-base the changes to whatever c5 version you are running.
It allows you to re-map any assets by defining site constants.
Thanks... theoretically, I have an idea how that would work, but in reality I have no idea what the site constants should be and I can't make heads or tails of the C5 API, so I don't think I'm quite up to the task.