Please provide an example for newbies

jdl100 - September 15, 2008 - 01:43
Project:jCarousel
Version:5.x-1.x-dev
Component:Documentation
Category:support request
Priority:critical
Assigned:Unassigned
Status:active
Description

I've used jquery and jcarousel outside of the Drupal environment, but I can't seem to get jcarousel to work with Drupal 5. I've installed jquery_update. I installed jcarousel in sites/all/modules.

In my template.php file, I've added these 3 lines:

drupal_add_js($data = 'sites/all/modules/jcarousel/jcarousel.js', $type='theme', $scope='header', $defer=FALSE, $cache=TRUE);
drupal_add_css($data = 'sites/all/modules/jcarousel/jcarousel.css', $type='theme', $scope='header', $defer=FALSE, $cache=TRUE);
jcarousel_add('tango');

Are these the right lines to add? If so, is this the right place to add them? If so, where exactly in the template.php file should they be added? If not, what files do I need to modify? and with what code?

I created a new page with this content:

<?php
drupal_add_js
('$(document).ready(function(){ $("#mycarousel").jcarousel();});','inline');
?>

But Firebug shows me this error (and jcarousel doesn't work):

$("#mycarousel").jcarousel is not a function

Any help that you can offer would be appreciated. A simple document with X Steps to use jcarousel that lists the exact files to edit, the edits to make, and exactly where in the documents to make the edits would help the Drupal newbies immensely!

#1

volocuga - April 14, 2009 - 11:18

Funny :) Can anybody show how does it work? Drupal is not for coders only.

#2

chroni - April 27, 2009 - 15:42

Nope. Because no one knows. Seriously, I feel like this is a scam or some cruel game to waste our time. I've scoured the web over the last month and I cannot understand for the life of me how something that is apparently "sooo cool" can be so poorly documented. I mean POOR! Even the Drupal documentation points to the developers site which has NOTHING to do with Drupal. And yet there are add-ons for this out there, such as here: http://awebfactory.com.ar/node/301.

I've been in and out of Drupal dev for a few years, and this is almost laughable if it wasn't so cruel.

For instance, in the above entry in this thread from user jdl100 lines are added to his template file. WHERE did he find documentation that says to do that? Pasted here is the documentation for jCarousel right from the READ ME and following it to the letter, on two different web sites I wanted to use it on, same results ...nothing.

Installation
------------
1) Place this module directory in your modules folder (this will usually be
"sites/all/modules/").

2) Enable the module.

And here is the the steps for jQuery which are done prior to the jCarousel

INSTALLATION:
1) Place this module directory in your modules folder (this will usually be
"sites/all/modules/").

2) Enable the module.

3) Copy all *.js files from the jquery_update/misc folder and place them in
Drupal core's misc/ folder, replacing the files that already exist.

Note: You will receive a warning message in Drupal's administration area if
you do not perform this step correctly.

Seriously folks, no really, seriously. After a person does this, NOTHING happens.

So I play along in the game, and go to http://sorgalla.com/jcarousel/ and there are working examples there. And I can copy/paste all the content and rebuild the same structure this guy developed on his site - and it does work - but none of it has a thing to do with Drupal.

volocuga - not a single soul has brought this to Drupal - not Wimm, no one.

#3

Rob Loach - May 12, 2009 - 05:28

See the jcarousel_help() function for some examples in the Drupal 6 version.

#4

rumburak - May 29, 2009 - 09:32

If someone hits the same error ($("#mycarousel").jcarousel is not a function), this is because the jcarousel javascript libraries are not loaded. Had the same error and solved it by correcting some paths of the library, since it was not found in the path the web page was indicating it is.

#5

Rob Loach - June 11, 2009 - 20:21

If you say how exactly you fixed it, or upload a patch, I'd be happy to commit it.

 
 

Drupal is a registered trademark of Dries Buytaert.