I've created the basic library module for flexslider. It includes a debug mode for loading the un-minified version of the library, uses the libraries module to load the files and implements hook_library.
There is also an empty Views integration module for Views Slideshow. I'll be working on that next. But this should be a good start.
I would have submitted a patch, but there's nothing in the repository yet so here's a zip of the code so far.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | FlexSlider - Cleaning house | 147.17 KB | minoroffense |
| #14 | Flexslider refactored - untested | 110.15 KB | minoroffense |
| #8 | FlexSlider - Loaded by Drupal.behaviors | 107.61 KB | minoroffense |
| #5 | FlexSlider - Views Slideshow Form Configuration Works | 90.29 KB | minoroffense |
| #4 | flex1.PNG | 441.67 KB | dddave |
Comments
Comment #1
minoroffense commentedI made a few typos in that last upload. This should fix the library info.
Comment #2
minoroffense commentedHere's the first working version I have with Views Slideshow. It's very basic, no configuration options as of yet. There are some oddities with Views Slideshow that I'm still trying to figure out. But it does work.
Comment #3
dddave commentedI cannot say how much I am looking forward to test this thing out. Hope I find enough time today. A huge thanks for tackling such an important piece of functionality.
Comment #4
dddave commentedCuriosity wins!
Enabling and applying for an already existing slideshow worked fine. Resizing flawlessly works for the main picture.
Main issues:
a) The visible navigation links are oddly placed on pic1 and should be avoidable (guess this comes with configuration options in the future).
b) Pager images aren't resized.
c) The overlay isn't resized. The overlay was created by putting the content of hidden fields as rewritten output of another field with this content:
I tested with a custom subtheme to adaptivetheme/pixture reloaded.
Awesome work so far. I happily test everything that you put up.
Edit: Just noticed that the "Activate Slide and Pause on Pager Hover" for pager items isn't working.
Comment #5
minoroffense commentedNot sure why the rendering is off like that. I haven't really tested the actual slider itself yet. I'm still trying to get all the features working. Views Slideshow is an "interesting" API to work with.
The basic configuration options for the slider are now working. I'm now going to tackle getting the default Views Slideshow controls to interface with FlexSlider. Once I have that, I'll start debugging rendering problems like the one you listed above.
Here's the latest build. Thanks for having a look!
Comment #6
minoroffense commentedIf you're feeling up to it, you can write some test cases for the main module (avoid tests for the views sub module, not sure how/if tests are needed)
We would need the following:
- Test permissions on administrative tasks
- Test that the debug mode loads the right file
Beyond that adding some kind of automatic version detection for the library registration would be nice. Read the version from one of the files in the FlexSlider package.
Also a hook_requirements to check for the library on install and during runtime. Make sure that it is always available.
Let me know.
Comment #7
minoroffense commentedI've gotten a little sidetracked with some other work so a new version today is probably not going to happen.
I'll try to have the code committed to this sandbox. If not, then I'll create on and then a a dev release. I think we have enough code ready for a full module already.
Comment #8
minoroffense commentedMost of the options work now. The last item is to get the views slideshow widgets (pager, controls, etc...) to control the slider.
Comment #9
sanduhrsPlease have a look at http://drupal.org/sandbox/sanduhrs/1326086
Among other things it contains a field formatter.
@minorOffense: We really should merge things, I gave you commit access to the sandbox.
Comment #10
ryanwebpage commentedI have added what I have so far. It integrates with nodes and views the same way as the Galleria module. I used that module as the base and did not have to change a lot to get it working. It also allows you add multiple configurations for flex slider so different content types or views can have separate flex slider configurations. @minorOffense check it out and see if you can integrate any of your efforts.
Comment #11
minoroffense commentedPerfect!
I'll start merging the two. I'm imaging a structure something like this in the final module
flexslider (main api module, implements the hook_library stuff)
-- flexslider_field (field level templates
-- flexslider_views (your views stuff)
-- flexslider_views_slideshow (my slideshow code)
Thoughts?
Comment #12
dddave commentedWhere will be the place to follow (and where will the dev show up?)? I think an easily accessible dev would help to get feedback.
I suck at coding but it seems that the plan outlined in #11 sound reasonable. Such a structure might make it easier for modules like field_slidshow to make good use of this module.
Anyways, thanks a lot for your efforts!
Comment #13
minoroffense commentedI'm still working on merging the code. I haven't had much time yet this week. But I should have something on Friday to start testing.
Comment #14
minoroffense commentedHere's the refactored version of the module. I moved everything into the folder structure listed below;
flexslider
-- flexslider_fields
-- flexslider_views
-- flexslider_views_slideshow
I left the option set code in the core module and added the hook_library implementation from my module. I removed the file caching code from the module since I wasn't sure if we needed it with the hook_library.
Outstanding items are automatic version detection in hook_library and hook_requirements and to reimplement the flexslider theme loading code to use hook_library_alter to load different flexslider styles.
This is totally untested code but i figure at least share what I have and people can help out with code fixes and bug fixes and maybe some test cases.
I should have a newer version, with the two issues above fixed, on Monday.
Thanks!
Comment #15
iaminawe commentedThanks for this. I am testing it at current and have it working off an imagefield. The frame resizes correctly but my image is stuck at a thumbnail size and currently there are no settings other than default in the field. This may well be because the module is at an early stage and so just reporting what I found.
I will test the next version too, look forward to the update.
Thanks for this awesome work
Comment #16
TIMe-2 commentedAs far as I understand, this is due to the fact, drupals default rendering for
-tags is with defined height and width values. To re-size the image analog to the viewport, the image-tag delivered by drupal needs to be stripped from these non css-dimensions.
Struggling to do this, too. Maybe someone has a clue how to manipulate the image-tag?
Great work for this integration so far. Thank you guys a lot.
Comment #17
minoroffense commentedI would imagine something simple like a template_preprocess_image() and removing the attributes would work well. Or a theme override for theme_image.
We can add that to the list of todos.
Comment #18
cutmedia commented@TIMe
Got this working withou stipping the image tags, you will need to add some css eg:
This should overide the height and width from the img tag.
A nice feature would be able to add caption text from an available field instead of the title and alt tags from the image.
Comment #19
TIMe-2 commentedSometimes it's easier than thought at first. thx cutmedia.
Comment #20
lennart commentedI installed the module from #14:
A couple of issues.
1) It only works if galleria is also installed.
2) It's not possible to make the standard image size bigger. It's now to small for most designs and thus not very adaptive since it'll float to either side untilll the viewport becomes quite small. In other words, a possibility to change the image style would be nice.
Otherwise it seems to work as expected :)
Comment #21
minoroffense commented1) I removed mentions of galleria (be sure to run update.php, there were some schema changes)
2) You can override the image style from admin/config/media/image-styles just like any other image style. Just click the "override" link and you can change it to do whatever you like.
Here's a new copy of the module with some more modifications. None of the major items are fixed yet. Mostly just code cleanup and minor bug fixes.
- No more references to Galleria (hopefully)
- Added stylesheet as per #18
- Named flexslider_img.css to avoid conflicts with default FlexSlider stylesheets
- Updated schema
- Updated default image style
- Removed commented out code
- Cleaned up default display template
I got delayed working on new code for Mobile Tools yesterday and today. But hopefully I'll have time to get some of the major items fixed.
Comment #22
lennart commentedI cannot get #21 to work at all. Any page with flexislider looses its css and everything coming after the image.
Comment #23
minoroffense commentedI'll have a look, I might have uploaded the wrong git branch or forgot to merge something...
Comment #24
ryanwebpage commented@minorOffense, I finally got around to putting a release on the project. It is the initial code that I copied from galleria without your changes. Can you merge your changes when you get a chance?
I am trying to figure out a way to attach links for slides. I was thinking of using the link module and field collections. So if both are enabled and flex slider is installed a flex slider field collection with image and link fields is available. It would require a field formatter as well to handle the output of the collection to remove a lot of the formatting that field collections does. Is this over complicating it? Can anyone think of a simpler way to get links on the slides?
Comment #25
minoroffense commentedCool!
I have some new code for it. I'll checkout/commit the changes to the project in dev.
I'll have to think about the field linking part. I'm a little short on time today but I can come back tomorrow and chime in.
Thanks a lot!
Comment #26
minoroffense commentedChanges are committed with some fixes as well.
Hook_requirements is now working correctly. The field display seems to work nicely and the images resize as needed.
I updated both the -dev and the 7.x-1.x branches. Once we get more testing done with the submodules, we can tag a release.
Well done everyone!
Comment #27
minoroffense commentedI think we're at the point now where people can submit issues to the issue queue instead of continuing this thread.
That way we can start accepting patches and such.
I'm closing this issue now.