Download & Extend

Please provide an example for newbies

Project:jCarousel
Version:5.x-1.x-dev
Component:Documentation
Category:support request
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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');
?>
  • Only local images are allowed.
  • Only local images are allowed.
  • Only local images are allowed.

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!

Comments

#1

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

#2

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

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

#4

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

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

#6

EDIT: I just realized that this thread is about the 5.x version of the module, and I'm using the 6-1.1 version.

I've got about 4 hours of my life I'll never get back while trying to get this module to work... as with others here I think I'm going to bail out and just dump the .js code directly into my document.

One thing I noticed while comparing the admin/help/jcarousel vs. my own test page was that inside the "jQuery.extend(Drupal.settings, {" statement:

On the help page it had
"jcarousel": { ".attachment-thumbs": { "scroll": 1, "skin": "tango" }, "#horizontalcarousel": { "skin": "tango" }, "#verticalcarousel": { "vertical": true, "skin": "tango" }, "#differentskin": { "skin": "ie7" }, "#jcarousel": { "buttonNextEvent": "mouseover", "buttonPrevEvent": "mouseover", "skin": "tango" }, "#jcarousel-1": { "buttonNextEvent": "mouseover", "buttonPrevEvent": "mouseover", "skin": "tango" } }

While NO MATTER WHAT I DID my test page always had only:
"jcarousel": { ".attachment-thumbs": { "scroll": 1, "skin": "tango" } }

When I dumped the file to flat .html and tried that out in a browser while changing the statement to:
"jcarousel": { ".attachment-thumbs": { "scroll": 1, "skin": "tango" }, "#MY_ID": {"vertical": true} }
Then it did work. Therefore it seems that for some reason that one missing bit is the culprit. I don't have any more time at the moment to try and figure out why this is happening.

#7

Status:active» fixed

The new version of the module (2.x) now includes Views support directly which will likely be used in most all situations (hence why viewscarousel project has twice as many users, since it actually does something useful). The README.txt file has been updated significantly to document how to use this module with Views. The 2.x dev version is available for download from the project page. I expect to have a new stable release out shortly.

The Drupal 5 version of this module is no longer supported.

#8

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here