Integrating GallerifficPlus with C5
Permalink
Hi, I'm having a problem integrating the GallerifficPlus jQuery plugin with C5.
I'm getting the following error in my Firebug console: $("#ccm-GalleryBlock-display40").galleriffic is not a function
From the research I've done, it seems the most common cause of this error is either not including jQuery or including it twice, which would override C5's copy. However, I am not attempting to include jQuery, since I know that C5 already includes it. (A check with firebug confirms that it has been included on my page before GallerifficPlus) It's not just GallerifficPlus, either; the most recent version of Galleriffic causes the same error.
I even checked inside GallerifficPlus' code, and galleriffic *is* a function, so I'm stumped. I'll attach relevant files -- my custom block's view.php and GallerifficPlus' script.
I'm getting the following error in my Firebug console: $("#ccm-GalleryBlock-display40").galleriffic is not a function
From the research I've done, it seems the most common cause of this error is either not including jQuery or including it twice, which would override C5's copy. However, I am not attempting to include jQuery, since I know that C5 already includes it. (A check with firebug confirms that it has been included on my page before GallerifficPlus) It's not just GallerifficPlus, either; the most recent version of Galleriffic causes the same error.
I even checked inside GallerifficPlus' code, and galleriffic *is* a function, so I'm stumped. I'll attach relevant files -- my custom block's view.php and GallerifficPlus' script.
Travis,
The call to that block tools function returns the desired URL -- tools/blocks/gallery, which is where my JS files are located. The problem is not in the javascript files not being loaded, because I can see in firebug that they are being loaded.
I said that I was using a custom block -- check the last paragraph. :)
I'll definitely keep in mind that I can copy the script to auto.js, but for right now I just want to get things working! (Also, I'm certain that there will never be more that one instance of this block on a page)
Thanks for taking the time to reply.
The call to that block tools function returns the desired URL -- tools/blocks/gallery, which is where my JS files are located. The problem is not in the javascript files not being loaded, because I can see in firebug that they are being loaded.
I said that I was using a custom block -- check the last paragraph. :)
I'll definitely keep in mind that I can copy the script to auto.js, but for right now I just want to get things working! (Also, I'm certain that there will never be more that one instance of this block on a page)
Thanks for taking the time to reply.
I'm assuming a block. In which case your call to
Would be leading you to the wrong path. getBlockTypeToolsURL() returns the following
tools/blocks/'your_block_handle"
Also loading the js they way you have will cause the plugin to be loaded multiple times if the block is used in multiple areas on the same page.
personally I would copy and paste the gallerific.js code into auto.js. This will load the js only once.