I've just installed Views Slideshow and I'm trying to get it to work. I've created a View that is supposed to be a single frame slideshow of photos contained within a particular node. I'm pretty sure I have the View set up correctly - I've followed all the instructions I could find here - but the slide show doesn't do anything. It shows one image, and doesn't change. This also happens if I try to make a slideshow that displays article (node) titles.

When I view my slideshow page in Firefox, and look at the Error Console, this is the error message I get:

Error: $(settings.targetId).cycle is not a function
Source File: http://[www.mysite.com]/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js?7
Line: 88

I checked the page source, and as far as I can tell, all the correct JS files are loaded:

jquery.js
jquery.cycle.all.min.js
views_slideshow.js

I've checked the issues database and can't find anything quite like this. I'm afraid I don't know what else to try at this point.

If you think I've forgotten any details I'll be happy to supply them. Thanks!

Comments

redndahead’s picture

Status: Active » Postponed (maintainer needs more info)

hmm it seems it should load. Could jquery.cycle be loading twice? Maybe you can try clearing your cache and see if that helps. Is there a site I can look at?

info_dump’s picture

I've just e-mailed you the URL. I would rather not post it on the forum.

Also, for the sake of being thorough, here is the exported View:


$view = new view;
$view->name = 'cafes_slideshow';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'field_photo_fid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'Cafe_Slideshow_Photo_default',
    'multiple' => array(
      'group' => 0,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_photo_fid',
    'table' => 'node_data_field_photo',
    'field' => 'field_photo_fid',
    'relationship' => 'none',
  ),
  'field_photo_data' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'data_key' => 'description',
    'exclude' => 0,
    'id' => 'field_photo_data',
    'table' => 'node_data_field_photo',
    'field' => 'field_photo_data',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'title' => array(
    'operator' => '=',
    'value' => 'Cafés Slideshow',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'case' => 1,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'cafes_slideshow' => 'cafes_slideshow',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 0);
$handler->override_option('style_plugin', 'slideshow');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
  'mode' => 'singleframe',
  'singleframe' => array(
    'timeout' => '5000',
    'delay' => '0',
    'speed' => '700',
    'random' => '0',
    'pause' => '1',
    'controls' => '0',
    'pager' => '0',
    'pager_type' => '0',
    'pager_hover' => '2',
    'image_count' => '0',
    'effect' => 'fade',
    'sync' => '2',
    'advanced' => '',
    'ie' => array(
      'cleartype' => 'true',
      'cleartypenobg' => 'false',
    ),
  ),
  'thumbnailhover' => array(
    'hover_breakout' => 'teaser',
    'teasers_last' => 1,
    'timeout' => '5000',
    'delay' => '0',
    'speed' => '300',
    'random' => '0',
    'pause' => '',
    'pager_event' => 'mouseover',
    'controls' => '0',
    'image_count' => '0',
    'effect' => 'fade',
    'sync' => '2',
    'advanced' => '',
    'ie' => array(
      'cleartype' => 'true',
      'cleartypenobg' => 'false',
    ),
  ),
));
$handler->override_option('row_options', array(
  'inline' => array(),
  'separator' => '',
  'hide_empty' => 1,
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'slideshow');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));

and the View's output:

SELECT node.nid AS nid, node_data_field_photo.field_photo_fid AS node_data_field_photo_field_photo_fid, node_data_field_photo.field_photo_list AS node_data_field_photo_field_photo_list, node_data_field_photo.field_photo_data AS node_data_field_photo_field_photo_data, node_data_field_photo.delta AS node_data_field_photo_delta, node.type AS node_type, node.vid AS node_vid, node_data_field_photo.nid AS node_data_field_photo_nid FROM node node  LEFT JOIN content_field_photo node_data_field_photo ON node.vid = node_data_field_photo.vid WHERE ((node.title) = ('Cafés Slideshow')) AND (node.type in ('cafes_slideshow')) AND (node.status <> 0)

Thanks for the reply!

info_dump’s picture

Oh, and I forgot to mention I cleared the cache. I had high hopes, but no such luck.

redndahead’s picture

Looking at the site it seems jquery is being loaded twice. Can you try to disable the module that is loading it the second time and see if it works.

info_dump’s picture

Oh, I see. I have calls for jQuery in my site.info file. If I remove it the slideshow works, but then that breaks other jQuery-based stuff on the site - specifically my various tabbed menus.

Any thoughts on getting them all to cooperate? Is there a way to get the slideshow to use the jQuery scripts I already have loaded, or to get my tabbed menus to use the jQuery script that the slideshow uses?

I am fairly new to Drupal, so if that's a dumb question then please bear with me.

redndahead’s picture

Status: Postponed (maintainer needs more info) » Fixed

You can use http://drupal.org/project/jquery_update to manage updating your jquery version in your site.

info_dump’s picture

Excellent - got it working. Thanks!

Status: Fixed » Closed (fixed)

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

bsuttis’s picture

Status: Closed (fixed) » Active

Same issue is occurring for me and looking at the source, jquery.js is not included twice nor does any js file appear to be. Occurs across different themes. The initial div with the first slide appears, along with controls and slide counter, but the previous pause and next links do not work. They are plain text and even clicking them does not do anything.

On page load I get this error in Firebug Console:

$(settings.targetId).cycle is not a function
  $(settings.targetId).cycle(settings.opts); 

Clicking on Next outputs this in Errors Console:

$("#views_slideshow_cycle_teaser_section_" + options.slideshowID).cycle is not a function
  $('#views_slideshow_cycle_teaser_s...+ options.slideshowID).cycle('next'); 

Same error for Previous and Pause/Resume except the cycle(') portion.

bsuttis’s picture

Status: Active » Closed (fixed)

Didn't realize downloading the .js file was required. Found out via http://www.brightwebsitedesign.com/how-to-install-views-slideshow-module....

You need to download jQuery cycle plugin and copy jquery.cycle.all.min.js to sites/all/libraries/jquery.cycle You can find the plugin at http://malsup.com/jquery/cycle

nirbhasa’s picture

Another suggestion - I was also getting those errors, even though I had the plugin downloaded. But then i realised the permissions on the default uncompressed jquery.cycle folder was 700 so i changed it to 755 and it worked.

Dipo’s picture

bsuttis,

Hi I am having the same problem with views slide show as you did. It doesn't seem like anyone was able to solve this problem. Did you happen to figure it out? Please let me know if you did thanks.

hedley’s picture

I had the same issue but then found out I was using an incorrect version of the plugin. Use this one: https://raw.github.com/malsup/cycle/master/jquery.cycle.all.js

MeanOldDad’s picture

I had the same issue and ran some debugging of the code and found that the file that it is looking for is named jquery.cycle.all.min.js (which is what the instructions tells you but who reads those anyways). The file from the link that it provides is jquery.cycle.all.js. Renaming the downloaded file to jquery.cycle.all.min.js worked for me.

Max_Headroom’s picture

#10 The page at that link shows how to install Slideshow for D7. But the tip to install jquery.cycle.all.min.js applies to 6.x-3.x as well. Found it out the hard way :)

wadmiraal’s picture

Version: 6.x-2.0-beta2 » 6.x-3.0
Component: Miscellaneous » Documentation
Category: support » bug
Status: Closed (fixed) » Needs work

Hi all.

I'm sorry to be a dork here by re-opening this issue, but I really think this hasn't been addressed properly.

The install of this module should be considered "broken" if a user has to go to Google, type "$(settings.targetId).cycle is not a function" and find this thread, only to read all the way through it and find out he has to download a separate file.

There should at least be a clear paragraph on the module page, like:

Dependency:

Requires you to download the jquery Cycle plugin to sites/all/libraries/jquery.cycle.min.js

Another good thing would be to include a call to drupal_set_message() in the install hook:

function views_slideshow_install() {
  drupal_set_message(t("You must download the jQuery Cycle plugin and put it in sites/all/libraries for the Views Slideshow module to work !"), 'warning');
}

I think this is really important. Drupal's goodliness is only as good to newbies as the worst module they have to work with (I'm not saying your module is crap, don't get me wrong here :-) - I'm just saying this generally speaking). So every module should be as clear and as easy as possible, to use and to install.

Cheers.

redndahead’s picture

I'm sure there is something that can go into hook_install or hook_requirements for views_slideshow_cycle. This wouldn't go into views_slideshow module itself.

wadmiraal’s picture

Component: Documentation » Cycle

@redndahead

You're absolutely right. My mistake :-). Changing the component to "Cycle".

pwhite’s picture

I had to add:

scripts[] = jquery.cycle.all.min.js

Into the .info file to get it working on Drupal 7.

bfodeke’s picture

For anybody using D6, the important thing is the directory that you install jquery.cycle. I installed it based on #18 and I spent the next two hours searching other threads. Just to clarify,

Install jquery.cycle.all.js to sites/all/libraries/jquery.cycle/jquery.cycle.all.js
kimadamson1’s picture

Thank you so much for the clarification. I did download this jquery file and placed it in the right spot. I just never found any place that told me what to name it.

Now my slideshow works properly. Thanks again!

Kim

wadmiraal’s picture

Priority: Normal » Critical

I really think the maintainers should address this issue.

People are still looking around the web for instructions on how to install this component and end up here. This is not normal. It would just take you 2 mins to add an instruction on the module page as I said in #16, and another 5 to add a message in the requirements hook.

redndahead’s picture

Status: Needs work » Closed (works as designed)

Thanks @wadmiraal for your suggestion and the patch for hook_requirements.

Instructions are in the dev release. And there is already an issue for hook_requirements. Please feel free to add your patch there.

Evangelo’s picture

This simple post here (#10) seems to me would probably solve a lot of problems:

#10
Posted by bsuttis on February 17, 2011 at 12:15am
Status: active » closed (fixed)

Didn't realize downloading the .js file was required. Found out via http://www.brightwebsitedesign.com/how-to-install-views-slideshow-module....

You need to download jQuery cycle plugin and copy jquery.cycle.all.min.js to sites/all/libraries/jquery.cycle You can find the plugin at http://malsup.com/jquery/cycle

I just don't understand why it wouldn't be documented on the Views Slideshow Project site ...with instructions where to get the jQuery cycle plugin (http://drupal.org/files/jquery.cycle-2.99.zip) and where it needs to go (sites/all/libraries/jquery.cycle).

Terebinth’s picture

Just had to login to comment as well. I seriously don't get it either. Just spent almost 2 hours trying to rectify a problem that didn't really exist. Is it really that hard for this important instruction to go into the read me file? :(

Omar Alahmed’s picture

#24 thank you, this

You need to download jQuery cycle plugin and copy jquery.cycle.all.min.js to sites/all/libraries/jquery.cycle You can find the plugin at http://malsup.com/jquery/cycle

solved it.

halth’s picture

#13 Worked for me. Thank you! :)

zerozeroisland’s picture

Yes! i had the same issue and it was a weird problem with downloading jquery.cycle.all.js straight from the website link.

trying to download the plugin from : http://jquery.malsup.com/cycle/download.html by right clicking and 'save as' will get you a file named jquery.cycle.all.js but the only content in the file is '301PermMove' haha oops.

So download the cycle plugin from github at: https://github.com/malsup/cycle, place it in a folder you create at sites/all/libraties/jquery.cycle/ and you should be good to go!

sstacks’s picture

I had trouble with this issue even after dropping the jquery.cycle js file in the /sites/all/libraries/jquery.cycle directory.

Turns out I was using a version of the cycle file that didn't work with my version of jquery (even with the Jquery Update module installed in Drupal 6).

Using the note on the Module page talking about Version 6 and Jquery Update, I searched around and found a 2.88 version of jquery.cycle, deleted the other version, dropped 2.88 in /sites/all/libraries/jquery.cycle and boom working.

Hope this helps someone else.

Best,
Shane

christine1126’s picture

Issue summary: View changes

Thank you sstacks, #29 works for me, very helpful, use 2.88 version http://ajax.aspnetcdn.com/ajax/jquery.cycle/2.88/jquery.cycle.all.js, it works good.

dwdusharme’s picture

I know this is pretty late in the game, but if you are having problems with the slides not cycling take a REAL CLOSE look at the name of the /sites/all/libraries/jquery.cycle/jquery.cycle.all.js Mine was misspelled: jqeury.cycle.all.js instead of jquery.cycle.all.js Since I don't touch anything it wasn't renamed by me.

I renamed it correctly and all was well.