Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I think a nifty feature for this module would be able to attach a view to a form of an entity. That way it can be display on a user account edit page or on a node form page. Would this be feasible or is there a module out there?
Comment | File | Size | Author |
---|---|---|---|
#13 | eva-form-1419328-13.patch | 10.85 KB | tim.plunkett |
#13 | interdiff.txt | 3.83 KB | tim.plunkett |
#9 | eva-form-summary.png | 22.66 KB | tim.plunkett |
#9 | eva-form-form.png | 25.67 KB | tim.plunkett |
Comments
Comment #1
Simon Georges CreditAttribution: Simon Georges commentedI closed #1301752: Show view on node edit form as a duplicate of this one.
Comment #2
chertzogI would also like to see this functionality.
Comment #3
mkadin CreditAttribution: mkadin commentedWe could try development on this, but it seems tricky / potentially out of the scope of EVA. Can you describe a use case where a view as a block on the edit page wouldn't do the trick?
Comment #4
chertzogi took my project in a different way. I no longer have a need for this.
Comment #5
mkadin CreditAttribution: mkadin commentedI dont' think this is EVA's purpose. There are several non-complex programmatic ways of doing this, and you can also just use a block.
Comment #6
windmaomao CreditAttribution: windmaomao commentedi would say this is a very nice feature, since currently i can't see this Eva field in edit form.
Maybe a generic way is to attach any view to edit form, not necessarily be eva view.
Comment #7
asiby CreditAttribution: asiby commentedSince mkadin clearly showed that this will not be done, here is how you can do it and the reason why I needed this.
We are building a system that will force people to work mostly from within the node editing form. And the same form contains various entity references.
It will be very useful for them to be able to just follow a link to the entity being referenced instead of seeing something like "John Doe (215)" for a user reference.
I was planning to use the EVA module to add a link that says "View this account" right next to the "John Doe (215)".
If this is the only reason why you have installed EVA, than uninstall it and go read about hook_field_extra_fields(). It lets you add an arbitrary peace of content in the form display or content display mode very easily. There are plenty of examples out there.
Let me know if you need more help using this.
Cheers
Comment #8
tim.plunkettI'm going to tentatively reopen this as a feature request.
If @mkadin still does not want it merged in, expect a "EVA: Form" module coming soon :)
Comment #9
tim.plunkettI've added another setting to the Views UI for this.
By default it will use 'display', ensuring that all existing views will continue to work as expected.
Attached are two patches. The one to actually use, and one ignoring whitespace changes, since I've indented a couple big hunks.
I would really appreciate someone testing this.
Comment #10
tim.plunkettD'oh! That thing when you refactor without testing afterward.
Comment #11
tim.plunkettForms cannot be contained by other forms, so we need to prevent the exposed forms from showing when the EVA is used on an entity form.
Comment #12
tim.plunkettWe need to check this value first since you can now attach this on entity create forms.
Comment #13
tim.plunkettThe ability to attach a single display to both a display AND a form is just not going to work.
Scenario:
This causes errors in template_preprocess_eva_display_entity_view().
Comment #14
alibama CreditAttribution: alibama commented#13 applies cleanly, and the UI is straight both in the view and in the content type… i'm not as successful in getting anything to render in the form, however… not sure if it's an issue between the chair and the keyboard or something else :)
Comment #15
zmove CreditAttribution: zmove commentedI think the feature perfectly fit the module scope, let's see the module description :
""Eva" is short for "Entity Views Attachment;" it provides a Views display plugin that allows the output of a View to be attached to the content of any Drupal entity."
Entityform is a drupal entity, so, by reading the module description, you should be able to attach views to entityform using EVA.
+1 for commit
Comment #16
Jochen Wendebaum CreditAttribution: Jochen Wendebaum commentedI need this functionality too.
Comment #17
Jochen Wendebaum CreditAttribution: Jochen Wendebaum commentedI also think that this fits the scope. You cannot do everything with blocks.
For example I use the entity_registration module, which opens a huge form for anonymous visitors, which they fill in in order to register for an event. I use a view and a block to show the event information ON TOP of the page, this works fine.
But at the end of the page, between the last field and the submit button, I want to add the admision fee, which is places in another, but related node as a field. I can do this with a tiny view, but putting it at the bottom of the page leads to the fee showing BELOW the submit button, not above as wanted.
A EVA field would allow me to do what I want.
Comment #18
geek-merlinNovice task: This needs additional manual testing.
Comment #19
geek-merlinUndoing erroneous summary edit.
Comment #20
geek-merlinTested on two sites and does what it announces without harming old functionality.
Code reviewed and old code paths should not be harmed. New code looks like expected.
Comment #22
geek-merlinFixed in 1.4-rc1, which will become 1.4 if enough people use it without bugs reported. See #2647732: Plan for EVA 7.x-1.4 release
Comment #23
DamienMcKennaCommitted.
Comment #25
maxplus CreditAttribution: maxplus commentedHi,
thanks for all the effort, I have just used 1.4-rc1 and added a view to a Group (https://www.drupal.org/project/group) edit form
Works great!
Comment #26
tonka67 CreditAttribution: tonka67 commentedI also used 1.4-rc1 to add an EVA view to an Entity Form. Works great as designed. Still not sure how I'm going to work around the loss of exposed filters, but I haven't encountered any bugs in the current version.
Comment #27
semanthis CreditAttribution: semanthis commentedThis new feature is just great ...one of the most useful modules ever. Thank You for all the work done...
Comment #28
semanthis CreditAttribution: semanthis commentedif the view is attached to a form the Exposed filters do not appear. Id might better create a new ticket.