jquery and concrete5

Permalink
I presume that jquery being just javascript with no conflict option plays nicely with concrete5?

With no major issues?

trixiemay
 
elyon replied on at Permalink Reply
elyon
Concrete uses jQuery generously, so if you need to use jQuery in your site you can skip the import and just start using it
trixiemay replied on at Permalink Reply
trixiemay
Thanks for your rapid reply.
briand replied on at Permalink Reply
Rather than starting a new thread.
Is there a way to detect if a Theme is already loading in jQuery?

I am creating a theme from a purchased template. That template already is using jQuery. Works great when not in edit/admin mode, but it won't work if jquery.js is included twice.

So my question is
a) Is there a way to detect if people are admins so I can put an if statement in to prevent jquery from getting loaded twice
or
b) Is there a way to detect if jquery has (or will be) been loaded in (by Loader::element('header_required');)?

I've done:
if (!$c->isEditMode()) {?>
<script type="text/javascript" src="<?php echo $this->getThemePath().'/js/jquery.js';?>"></script>
<?php }?>

but screws up all jquery elements when I'm just 'viewing' the page.

Any guidance would be appreciated.
elyon replied on at Permalink Reply
elyon
You shouldn't have to include jQuery at all, since it's always included.

As for other scripts there is an addHeaderItem function you can use. Here's a post with more information:

http://www.concrete5.org/index.php?cID=4437...
briand replied on at Permalink Reply
You shouldn't have to include jQuery at all, since it's always included.

Gotcha. Because I'm putting the theme together I didn't notice that the Script That was there before wasn't working at all. When I put it into 'edit mode' it didn't work at all.

I didn't realize that jquery is always included with the Concrete pages when you use the 'header_required'.

Still makes me concerned about jquery versions and conflicts with other libraries...

Still easily the best user friendly CMS out there! I can't wait to write my own 'plugin'.

Great work keep it up!
kelbyuk replied on at Permalink Reply
kelbyuk
is jQuery UI included by default?

I am having issues with trying to get a jQuery sliding menu to work,

jQuery("#HorizontalSlidingMenu .slidingMenu").slidingMenu is not a function

is one of the errors I get and not sure how to fix this.
glockops replied on at Permalink Reply
glockops
Yep. jQuery is included by default:
<script type="text/javascript" src="/concrete/js/jquery.js"></script>
glockops replied on at Permalink Reply
glockops
You might take a look at what I've done using jQuery transitions - not sure if it's similar to what you're after..

http://www.smwc.edu/homepage

View the source to get the scripts, specifically the "/blocks/page_list/templates/homepage_news/view.js"


It uses the jQuery Cycle Plugin:
http://jquery.malsup.com/cycle/...
jgarcia replied on at Permalink Reply
jgarcia
jquery is included on all C5 pages. jquery UI is only included when logged in.