Comments

dagomar’s picture

Pretty sure you can use views to achieve this.

bendikrb’s picture

Sure you can; you can use views to do alot of things - but I don't see how that's relevant to this reequest..

dagomar’s picture

I 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.

bendikrb’s picture

Views 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...

dagomar’s picture

I agree it would be a lot more easy if the module provided this functionality :)

arrubiu’s picture

I 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..

minorOffense’s picture

Component:Code» Fields Integration

I won't be adding this to the module myself. But if someone wants to write the patch I'll be glad to review.

minorOffense’s picture

Issue summary:View changes

Changed to htmlentities

das-peter’s picture

Issue summary:View changes
Status:Active» Needs review
StatusFileSize
new6.24 KB
Test request sent.
[ View ]

Here 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.

attiks’s picture

Patch looks good, only found 2 minor code style issues.

  1. +++ b/flexslider_fields/flexslider_fields.module
    @@ -122,10 +159,17 @@ function flexslider_fields_field_formatter_settings_summary($field, $instance, $
    + * Prepares a renderable array of images and adds the necessary JS and CSS

    Missing dot

  2. +++ b/flexslider_fields/flexslider_fields.module
    @@ -147,26 +191,31 @@ function flexslider_fields_field_formatter_view($entity_type, $entity, $field, $
    +        // If not style set, we have to call theme_image since theme_image_style

    Typo: If no style

das-peter’s picture

StatusFileSize
new6.24 KB
Test request sent.
[ View ]

@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']) in theme_flexslider_list_item().

Lukas von Blarer’s picture

Works for me. RTBC?

Lukas von Blarer’s picture

StatusFileSize
new6.29 KB
Test request sent.
[ View ]

Nope. 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.

rolfmeijer’s picture

The patch from #12 works. Thank you all very much, it was exactly what I needed.

groovedork’s picture

Would this formatter allow for a mix/choice of

- responsive images (picture)
- video embed

at the same time?

rolfmeijer’s picture

@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.

groovedork’s picture

Issue summary:View changes
StatusFileSize
new55.56 KB

I'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..

jerry’s picture

Status:Needs review» Reviewed & tested by the community

#12 is working well for me, too. Let's get it committed, please.