Issue with jQuery UI and Concrete

Permalink
Hey all, I need to use jQuery UI on my page, however when I login in the editor crashes, but when I remove jquery UI from my footer, the login is fine but the page doesn't work.

I realize that concrete automatically uses jquery UI when editing, however I need a means to get the cms to realize that I'm not in edit mode and that it should inject jquery ui.

<?php $c = Page::getCurrentPage(); if (!$c->canViewToolbar()) { echo '<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.min.js"></script>';}; ?>

I tried this, along with some other things, however all I've gotten are more errors. This one won't allow me to assign Page::canViewToolbar and gives a fatal error.

Anyone have experience injecting jquery UI when not editing?


For more information:
On the front end, with that line of jquery included, I get these errors

Uncaught TypeError: Cannot read property 'length' of undefined jquery.js:2
Uncaught TypeError: Cannot read property 'loaderImage' of undefined ccm.app.js:3

I know these errors are coming from these scripts being loaded:
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.min.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="<?php echo $this->getThemePath();?>/js/jquery-mobilemenu.min.js"></script>

Basically I need a way for C5 to detect that we're not logged in, and then to php echo these script files into my footer and I'm struggling to find the correct solution.

View Replies:
Soccham replied on at Permalink Reply
Ah sorry, my solution ended up with me just having to remove all jquery calls from the site as a whole. That seems to be working.