When adding an image field from a webform to a view using this module, it not possible to select the formatter and image style.
Instead you are limited to a plain "Format" option, which allows some options when it comes to image styles, but doesn't allow usage of more advanced features (eg: colorbox).

Comments

bserem created an issue. See original summary.

bucefal91’s picture

Project: Webform Views Integration » Webform

Hello!

Webform Views module simply transparently provides the options for formatting such as offered by Webform. So the problem belongs to Webform domain.

If you explain what specific extra features you need, I could allocate some time and code a patch.

jrockowitz’s picture

@bucefal91 I feel that the Webform module is just for collecting data and file uploads. I am against adding and maintaining advanced display functionality. For example, displaying an image using a colorbox would not work within an email.

If someone needs to integrate with advanced image handling and formatting they should probably be using Field API via the Contact module.

BTW, I am not saying absolutely no.

bucefal91’s picture

I am fine with that decision. I shifted into Webform because it also didn't belong to Webform Views (I am not going to do formatting in the webform views module neither).

Probably it can be implemented as an extra contrib module (webform_extra_format) or something like that. I personally feel the request in this feature has sense - it's natural to want to display some fancy stuff. And I very agree with your point - webform module is already big and it has enough responsibility in its current state.

Let's see if bserem has any input/thoughts. Also, I will try to look through webform module source code to make sure it's possible to extend and add extra formatters through contributed module. I will write here when I have time to study this "extendibility" through formatters.

jrockowitz’s picture

WebformElement formatters are not easily extended because all the logic is contained in the WebformElement plugin.

If we add extendable formatters to the WebformElement plugin we are going down the path of replicating Field API in the Webform module.

Since WebformElements support custom Twig templates, developers can customize the output of any element including images.

bucefal91’s picture

hello, Jacob!

Yes, i've looked through the code. I guess the best answer we can give is to suggest create a new element type and have it extend the desired element class. Then they could override the WebformElementInterface::getItemFormats() and do any other custom logic in the subclass. This seems like the best possible idea for any customization.

Or, as you said, if they need some kind of quicker solution, then they have twig template. Should we close it as won't fix or what should we do to this ticket?

bserem’s picture

The discussion is going to paths I can't follow codewise. I understand the decisions of not adding/replicating functionality from Fields into webforms, and it actually makes perfect sense.

I dare say however that this is not about using twig, it is about using views.
The view builds up a structure easily and allows people to not edit twig files.
Colorbox is just an example in this case, it could be some other formatter (not that I can think of something at the moment though!).
In the case of Views, simple point-n-click actions are required to get your output, which might not be possible with plain twig as far as I can say, because twig will act on the final rendering, where as the formatter will act while build the view.

jrockowitz’s picture

Status: Active » Closed (won't fix)

@bserem I understand your requirements and if you need a more advanced presentation, you might need to use Field API.

The Webform module is just a form builder and submission manager. The Webform module's presentation layer is solely meant to allow someone to review the submitted data. For example, in the case of images, someone uploads an image and then someone needs to see the image. The
Webform Views Integration module just makes it possible to build custom lists of webform submissions.

The Webform module provides Twig support to allow developers to customize the presentation layout.

In #6 @bucefal91 is also pointing out the developers can extend and override any existing webform element and even override a webform element's plugin definition.

bserem’s picture

I will check into Field API, thanks!

bserem’s picture

Related issues: +#2792583: Use Field API