Closed (won't fix)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2018 at 10:52 UTC
Updated:
14 Mar 2018 at 12:16 UTC
Jump to comment: Most recent
Comments
Comment #2
bucefal91 commentedHello!
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.
Comment #3
jrockowitz commented@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.
Comment #4
bucefal91 commentedI 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.
Comment #5
jrockowitz commentedWebformElement 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.
Comment #6
bucefal91 commentedhello, 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?
Comment #7
bserem commentedThe 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.
Comment #8
jrockowitz commented@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.
Comment #9
bserem commentedI will check into Field API, thanks!
Comment #10
bserem commented