Jquery Conflict in edit mode

Hi I'm using a lot of scripts in a site I'm building, all seem to be playing nicely together and work fine in and out of edit mode apart from the homepage where the edit button disapears. Can anyone shed a bit of light on the subject! I'm just trying things that I don't really understand how to implement properly and going round in circles!!

Help would be greatfully received!

Cheers, Matt

View Replies: View Best Answer
Matteld80 replied on at Permalink Reply
I found this on a few forum posts

$page = Page::getCurrentPage();
if(!$page->isEditMode()) {
<script type="text/javascript">$(function() { alert('Not Edit Mode'); });</script>

Not sure where to put this or 100% how to reference my code into it
PineCreativeLabs replied on at Permalink Reply
A couple things to consider looking at, as possible causes for the problem:

1. Are you loading your own version of the jquery library? If so, Concrete already includes jquery, so this may cause a conflict if you're trying to add your own.

2. If you are modifying a theme, make sure that the header.php and footer.php files are being included.

3. You can always disable your scripts while in edit mode. Try searching the documentation or forums on how to do this.

If someone else can think of something, hopefully they'll jump in here.
Matteld80 replied on at Permalink Reply
Hi growthcurve

The first 2 points you raise are all fine and I'm not sure on how to implement the in edit mode fix.... I've tried it in a few places all to no avail, wasted about 3 hours looking for a fix for this now
drbiskit replied on at Permalink Best Answer Reply
Use this to add content dependent on whether logged in, or not...

global $u;
if ($u->isLoggedIn()) { ?>
   // Content if logged in
<?php } 
else { ?>
   // Content if not logged in
<?php } ?>
Matteld80 replied on at Permalink Reply
Thanks drbiskit... thats fixed the problem! Very greatful

Much love :)
Deladroid replied on at Permalink Reply
What if you want the page to look as it does when not in edit mode? My page uses some jquery sliders that I've tried with and without including my own libraries, and I've got as far as when the Toolbar is active (signed in as admin), the slider alters a bit. I'd ideally like the page to represent close to the live state as possible. Especially for the purpose of a client editing the site.

I like the idea of adding a "disabled message" when Toolbar/Edit mode, but I'm exhausting alternatives first.
jordan3949 replied on at Permalink Reply
You saved me a lot of time and frustration. Thanks!