It would be great if we could choose which slide to start with on load, and determine it based on variables. So let's say my content has a datefield, and I want the one that matches today's datefield to be the main page with previous and next day options to see the last/upcoming days, this option would provide so.

Comments

udig’s picture

Hi whatsnewsisyphus,

Good idea. I would like to bring this feature in.

Here's a hint on how to make the module support this feature.
On the ajax_slideshow.js file after line 108, add the following line:
initialIndex:Drupal.settings.ajax_slideshow.initialIndex,
Now open the ajax_slideshow.module file and go to line 211. This is where the js variables are being set so you may add here the following variable:
initialIndex => $requiredIndex,
Where $requiredIndex is the index of the node you want to appear first (you may calculate it using a special function).
In addition to the above you need to disable the preloading - go to the ajax slideshow configuration page and turn-off the relevant check box under the advanced settings section.

The above is bad solution in terms of backward compatibility as it breaks the module code but if you need this behavior go for it.

It would be awesome if you can write a patch which generalizes this feature so I can bring it into the module on the next release.

Good luck.

arpieb’s picture

I'm new to AJAX Slideshow, but it seems that you could leverage a couple other modules without hacking the code... Couldn't you do the following?

  1. Install Dynamic Field module, and add one of these fields to your slideshow content type via CCK.
  2. Code the field to calculate a "weight" based on your criteria. This field calculates on the fly when the node is referenced, so should do this every time you query for the node. (Not sure how Views will impact this, but imagine it should work as expected.)
  3. Alter the sort criteria in the View ajax_slideshow_view to use this field to sort the slides.

Am I oversimplifying this solution...? I'm actually playing with Draggable Views to allow a client to reorder slides using the "order" field assigned by that module as part of my view sort criteria, and so far it appears to be working...

udig’s picture

Great idea.
Thanks arpieb

udig’s picture

Status: Active » Needs work