Closed (fixed)
Project:
Flex Slider
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
26 Aug 2013 at 18:25 UTC
Updated:
22 Sep 2013 at 17:51 UTC
Jump to comment: Most recent file
In a minute I'll upload a little PoC that adds support for Flexslider 2.2.0 thumbCaptions and also adds support for choosing a field as a caption field in views (needed to support thumbnail captions in views as thumbCaptions uses a data property). If you like this but want thumbCaptions & views captions separated or would prefer it done some other way, please let me know.
Cheers!
JP
Comments
Comment #1
minoroffense commentedOne patch is fine.
Comment #2
jpstrikesback commentedHere is the patch.
Note: this also includes the fix in #2029811: Grouping fields are not saved in FlexSlider style options.
Comment #3
jpstrikesback commentedOops, here is the patch.
Comment #4
minoroffense commentedCan you add a note on the option set form indicating that feature requires the FlexSlider library 2.2 or higher.
I have a similar piece of text created for the allowOneSlide option once it gets added. You don't have to lock out the field, just warn the user.
Bonus points if you add an element_validate callback we could add to warn on save as well (something like _flexslider_validate_minimum_version_22 as the callback).
At the same time update the patch to exclude the += stuff from the already committed code.
Comment #5
jpstrikesback commentedHere is the cleanup and the req. note. Just looking into #element_validate.
Comment #6
jpstrikesback commentedHere it is with an #element_validate that uses php's version_compare to check against the version returned from libraries_detect().
Comment #7
jpstrikesback commented^^ That also renames the form element title to "Thumbnail Captions" rather than "Use Thumbnail Captions" as nouns seem the way to go...
Comment #8
minoroffense commentedComment #9
minoroffense commentedWell done! One bug in the code though.
Looking at the docs for version compare, we'll need to add the operator argument. As it stands the validation will fail if the version is lower or higher than 2.2. In our case we want anything higher or equal to pass and fail below.
Use the "ge" option (or the symbolic version)
http://php.net/manual/en/function.version-compare.php
Comment #10
jpstrikesback commentedCheers! That was bothering me as well!
Comment #11
jpstrikesback commentedI used '>=' as the op rather than 'ge' as it seems a little easier to read/understand. Thanks for the help!
Comment #12
minoroffense commentedI adjusted some of the code a bit and fixed some bugs with Views. Can you try this out? Should be good to go.
Comment #13
jpstrikesback commentedLooks good from a read, but I'll give it a shot later tonight.
Cheers
Comment #14
jpstrikesback commentedOne minor problem:
$settings['optionset']->options['thumbCaptions'] isn't necessarily set and throws a notice for a bunch of the examples.
So something like:
Comment #15
minoroffense commentedRight of course. Duh me.
Comment #16
jpstrikesback commentedHaha, that little bit is my fault...I just haven't had a moment to switch gears and work on it again...
Comment #17
minoroffense commentedI pushed the 2074499 branch. You can checkout the code from there if need be.
Comment #18
minoroffense commented