I have read that it is possible to override the function in the 5.x versions of the jCarousel Lite module.
But how would I do this for the 6.x versions?

Any guidelines are appreciated!

Thanks in advance!

Comments

owahab’s picture

Status: Active » Fixed

I have added a section to the module's documentation which should answer your question.

ptitb’s picture

Thank you for the update!
I looked for the section but can't find it in the documentation.

Where would I be able to find the guidelines to override a function?

Also in the documentation you mention that it is possible to change a template file to edit the arrows,
but when I open this template file I don't see any code refering to the arrows.

If I would be able to overide the function I could change the arrows there.

Thank you in advance!

ptitb’s picture

Status: Fixed » Needs review

status change

jm.federico’s picture

This info would be great, I'm lost there too!

neilnz’s picture

Version: 6.x-2.0-beta4 » 6.x-2.x-dev
StatusFileSize
new1.34 KB

I also couldn't find this functionality. I needed to add an afterEnd callback to the carousel that views was adding.

I've patched the jcarousellite_views module to support drupal_alter() on the js params, so another module can add to them or change them, eg.

function mymodule_jcarousellite_views_js_alter(&$params, $vid, $c, $options) {
  $params['afterEnd'] = 'mycallback';
  $params['mouseWheel'] = false;
}

It also uses drupal_to_js() instead of manually writing the config vars. I think it would be cleaner still to put the config in Drupal.settings then have a behaviour that sets up the carousel, but that's another issue.

neilnz’s picture

Actually had to revise this. The beforeStart and afterEnd params are JS functions that can't be passed as a string, so have to manually detect them and not escape the function names. Revised patch attached.

neilnz’s picture

Sorry that patch had some extraneous stuff in it. Here it is again with just the jcarousellite_views.module file.

dkingofpa’s picture

Modified the patch in #7 so that it can be applied from the root of the module instead of neilnz's special paths.

dkingofpa’s picture

Re-rolled patch in #8 so the call to drupal_alter will work in PHP 5.3. This will also still work with PHP 5.2