Adding Javascript breaks editing ability
Permalink 2 users found helpful<script type="text/javascript" src="js/mootools.js"></script>
AFTER
<?php Loader::element('header_required'); ?>
in the default theme header.php
BUT
when loading web page, the Edit Page / Add Page front end buttons/java do not work.
Any help would be appreciated.
Im loving C5 but this i sdriving me nuts :)
Frank
here's the request:
http://www.concrete5.org/community/features/jquery_noconflict_repos...
But there's not reason because as Scott said, I can do everything with jQuery I want.
There are a couple of scripts that use mootools and if you're a copy & past programmer, you probably have a problem, but beside that there's not need for anything but jQuery.
If I work with rails I use prototype, with c5 jQuery and I'm fine with that..
Looks like all the people who are willing to fix that problem don't really have problem ): Sorry!
Ok Im on borad with jquery/C5. What I am not clear on is would i sill put the includes/jscrip referances AFTER the <?php Loader::element('header_required'); ?> and the front end wont break , or should I be able to load before the Loader and expec everything to work?
Thanks, Frank
I usually do this from either the block controller but more and more from the blockview since different views by definition should be what changes the way the content looks.
So If i understand, jquery is already part of the base frame work and all i should need to load after the header-Required statement is for example lightbox.js and not jquery.js stuff?
And then load the lightbox.css anywhere in the header?
Thanks, Frank
Thanks for al lyour help , while I have yo and I appreciate this is off topic .. I reded every thing as we discuss and there are no apparent conflicts .. thanks. My question is when I put initialzation code like
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
In a content block, the editor comments out the code when i save it. Q: How can I included javascript in content block?
Thanks, Frank
There is a raw html block in beta, not sure if it is ready for prime time. This would allow you to have a gallery'd image without holding your hand in regard to html.
Otherwise to mix content and images to look like a newspaper you would almost need a totally custom new contentblock...
The main different was that I did not have to initialize the page via a jscript function. What I am trying now is a C5 add-on called php-block and it seems to be rendering the page properly but It's still not exectuing .. Ill work it out and learn from this experience . Thanks again for your time and patience.
Have a good one,
Frank
http://mootools.net/blog/2009/06/22/the-dollar-safe-mode/...
(I do agree with them that you shouldn't run both at the same time while not in edit mode)
You need to load any javascript and have the jquery and header_required loaded js loaded afterward to ensure that the core concrete5 js files are referenced and their code isn't overwritten.
I had issues with this with a foxycart block i made for a site.
I would personally like to see jquery run in a no conflict mode with some sort of $c5 instead of the default $ or something along those lines.
I could probably sit down and do this using a find/replace looking for $( and replacing with $c5( and overriding the header_required (did a post on that to use google version).
I have glanced at jquery noconflict but I haven't had a compelling reason to really switch it over...
To me I haven't found a really compelling reason to do something in mootools that I can't do in jquery. I would like to see a few examples if you must as to why you would like to use mootools. I am not in any way shape or form trying to dissuade you from using mootools especially since jquery is built to run in no-conflict where needed...I would just love to see what I am missing and why you are looking to use mootools.
-Scott