Now there is 3 options when prepolutating value for an entity reference via url :
Do nothing
Hide
Desactivate
How about adding a "display rendered entity" as the reference is given why do not display the rendered entity even if we are in edit mode.
My use case is the following :
I've got an A entity with a link that feed a B entity with it's reference (ref to A) when the link is clicked i would like to display a summary of the A fields in B (i.e the rendered entity prepopulated with A id) and ask for user to complete other fields of B then save contribution.
Now i could only have a display of a not very friendly ref field in the new B page instead of the A content during B creation.
Is there a way to do that ?
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | entityreference_prepopulate-rendered-entity-action-2126203-13.patch | 4.76 KB | jgullstr |
Comments
Comment #1
jgullstr commentedHi,
I needed this for a project I'm working on. Provided is a patch that lets you display prepopulated fields as rendered entities. Select the action "Display rendered entity" and desired view mode in the fields instance settings.
The action overrides the fields theme function and instead displays the rendered entities. I'm not sure that this is the best approach, but it works :)
//Josef
Comment #2
ranroz commented@jgullstr
Thanks for your comment.
The patch looks good to me.
Comment #3
ranroz commented@jgullstr
Thanks for your comment.
The patch looks good to me.
Comment #4
chris_h commentedI get the following error:
Fatal error: Cannot redeclare entityreference_prepopulate_theme() (previously declared in /sites/all/modules/entityreference_prepopulate/entityreference_prepopulate.module:23) in /sites/all/modules/entityreference_prepopulate/entityreference_prepopulate.module on line 227
Comment #7
jgullstr commentedComment #8
jgullstr commentedRe-roll for latest dev.
Comment #9
jgullstr commentedComment #10
jgullstr commentedLowering priority to normal, added "Needs tests" tag.
Comment #11
jgullstr commentedThe theme function in the last patches should not be necessary. Here's a cleaner patch.
Comment #12
jgullstr commentedAdded test to #11
Comment #13
jgullstr commentedLets try that again with a sane test case.
Comment #14
anybodyNeeds reroll against latest 7.x-1.x-dev!