Closed (fixed)
Project:
Flex Slider
Version:
7.x-2.x-dev
Component:
Fields Integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 May 2013 at 06:12 UTC
Updated:
27 Aug 2015 at 13:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dagomar commentedPretty sure you can use views to achieve this.
Comment #2
bendikrb commentedSure you can; you can use views to do alot of things - but I don't see how that's relevant to this reequest..
Comment #3
dagomar commentedI mean, why not just use a view to create a flexslider block/panelpane or even use a views-field to print it where you want? I just had to do this exact same thing today, that's why I came across your post. Just seems unnecessary to create a module for it... I ended up using a view in a panel pane and it works like a charm, I am using a media field with files, images, youtube and vimeo video's, all displayed in a uniform way through views.
Comment #4
bendikrb commentedViews adds alot of overhead which is really unnecessary for this simple task.
I mean, the module I created is about 100 lines of code, and would maybe require 50 extra lines of code if it were to be patched into the flexslider_fields module...
Comment #5
dagomar commentedI agree it would be a lot more easy if the module provided this functionality :)
Comment #6
arrubiu commentedI think that we have "simply" to add some code to the module, that now works only for "media" and "image" fields.
Adding "file" is not enough..
Comment #7
minoroffense commentedI won't be adding this to the module myself. But if someone wants to write the patch I'll be glad to review.
Comment #7.0
minoroffense commentedChanged to htmlentities
Comment #8
das-peter commentedHere we go.
The attached patch adds a formatter that integrates with file entity view modes.
That way the rendering of the single file item is handled by the file entity module with the file display settings and flexslider fields just takes care of, well, sliding.
This should work with image, media and file fields.
This approach also provides a away to render responsive images with the picture module.
Comment #9
attiks commentedPatch looks good, only found 2 minor code style issues.
Missing dot
Typo: If no style
Comment #10
das-peter commented@attiks Thanks for the review :)
Both comments are adjusted.
Btw. a bit off-topic but is there a reason why we've to render the things to put into
$item['slide']?I think the code would be more "flexible" and thus easier extensible when we would do a
render($vars['item'])intheme_flexslider_list_item().Comment #11
luksakWorks for me. RTBC?
Comment #12
luksakNope. Kept getting the following notice:
Notice: Undefined variable: is in flexslider_fields_field_formatter_settings_summary() (line 134 of /sites/all/modules/flexslider/flexslider_fields/flexslider_fields.module).The attached patch fixes the issue.
Comment #13
rolfmeijer commentedThe patch from #12 works. Thank you all very much, it was exactly what I needed.
Comment #14
groovedork commentedWould this formatter allow for a mix/choice of
- responsive images (picture)
- video embed
at the same time?
Comment #15
rolfmeijer commented@groovedork
Yes, both responsive images and video embeds are possible with the file entities formatter. The one thing I haven’t been able to do is to make video stills responsive.
Comment #16
groovedork commentedI've never applies a patch before, so I might be doing it wrong, but I get an error.
// nevermind, the patch should be run against the dev version. Could have known that..
Comment #17
jerry commented#12 is working well for me, too. Let's get it committed, please.
Comment #18
jantoine commentedRe-rolled #12 against the latest dev.
Comment #19
minoroffense commentedInstead of calling the hook_field_formatter_view in File Entity directly
It should be using
module_invokeinstead. That way other modules can alter (I know right now field_formatter_view doesn't have an alter hook but there's a contrib module that adds one or something apparently). Either way, shouldn't call hook invocations directly.Also, could you include some docs in the README.md file explaining how to use this and in what cases it makese sense to use it.
Once that's done, I'll give it another look and I think we'll be good to go.
Comment #20
das-peter commented@minorOffense Thanks for the feedback.
Here we go, hope the readme addition makes sense.
Comment #21
jerry commentedThis appears to be working fine for me. Thanks, das-peter.
Comment #22
minoroffense commentedThanks everyone.