Hello,
I'm a long time user of the flexslider module, typically for simple slideshows. Today, however, I needed to add a carousel as navigation for my slideshow and found it to be slightly cumbersome and error-prone having to hardcode an ID into the optionset settings. It seems to me that it makes more sense to have the navigation carousel auto-generated so that you don't have to manage the IDs yourself. So, my proposal is a few new options to the optionset settings:
- Paging Controls: A new "Carousel Navigation" option
- Thumbnail Carousel Optionset (dependent field on above option being set): A drop down to select a different optionset to render the carousel navigation.
- Thumbnail Carousel Image Style (dependent field on above option being set): A drop down to select an image style to apply to the navigation items.
Then, in the preprocessor for the flexslider theme implementation, we render another flexslider with the provided settings and link it to the main slider as the navigation (and we sync the main slider to the navigation as well).
Attached patch does what I propose above and includes a new entry in the README.md to describe the configuration.
Thanks for your time!
drclaw
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | flexslider-carousel_pager-2487672-13.patch | 10.77 KB | johan den hollander |
| #7 | interdiff-2487672-6-7.txt | 667 bytes | drclaw |
| #7 | flexslider-carousel_pager-2487672-7.patch | 11.1 KB | drclaw |
Comments
Comment #1
drclaw commentedThe last patch had a small error in which the pager was not display in some cases (specifically where it's being rendered twice or more). New patch addresses that issue.
Comment #2
drclaw commentedOkay, third time's a charm. Just one more fix for multiple slideshows with the same settings. Since optionsets are only added to the page once per machine name, we need to make our optionset names unique when they're pager_carousel enabled. Patch attached.
Thanks!
Comment #3
jantoine commentedThis patch works, but thumbnails were not using the image style selected in the Flexslider optionset. The attached patch generates thumbnail items using the selected image style. I also removed a bunch of unrelated white space changes. An interdiff is attached as well.
Comment #4
dubs commentedThis is a great patch - thanks :-)
However unfortunately it doesn't work with views. If I have time to solve on this project I'll get back with a patch, but I thought you ought to know.
Comment #5
minoroffense commentedI'll need to review this in detail. I'll book some time (finally) at the end of August.
Comment #6
jantoine commentedSmall bug fix that was introduced with recent changes to the module.
Comment #7
drclaw commentedThanks @jantoine for picking this one up! Quick update to better support using a custom id (instead of the auto-incrementing flexslider counter). Flexslider already supports this, but the navigation was throwing an error because it was looking for the auto-incremented number which isn't used when you use your own id.
Comment #8
seanbSeems to work for me! Nice solution. A few remarks:
Have not tested it with views though. Only in a field formatter.
Comment #9
ConradFlashback commentedPatch works in field formatter but not in a views display block.
This is the error:
Notice: Undefined index: item in template_process_flexslider() (line 124 .../sites/all/modules/flexslider/theme/flexslider.theme.inc).
Comment #10
minoroffense commentedComment #11
jantoine commented@seanB,
I vaguely remember specifically adding the '0' key due to a change in the Flexslider module. Are you using the latest dev?
@ConradFlashback,
This will not work with views because the Flexslider theme function expect an object to be
pastpassed that an image style can be applied to. In the case of views where you can return more than just an image as a slide (i.e. an entire rendered entity), views simply passes the rendered object and doesn't know how to generate a thumbnail from the data.In light of this, it seems it would be more appropriate for this functionality to be implemented separately for each submodule (views, fields, etc.)
Comment #12
seanbYep, using the last dev. Where you using a fieldset or something that could be adding another level to the element array?
Comment #13
johan den hollander commentedRerolling the #7 patch. Could not get it to work with composer patching.