I feel that a widget type is missing for this module. One should be able to allow adding a field collection in a modal window.
On a new entity creation I would expect the widget to have 1 link available that says "Add new [field collection field]". When clicking it a new modal window would show that allows specifying values for the fields. Upon submission of the modal window it would close and the add/edit/delete links would be inserted into the place where the field might have been when using embedded widget. We could also add a summary of the values in the field collection so as to better know what is there.
Hope this makes sense, let me know if you have any questions. But I personally think this is an appropriate step for the UI of field collection module.
Comments
Comment #1
jlyon CreditAttribution: jlyon commentedI was able to achieve this using the ctools_automodal module. Search the issue queue for the 2.x branch and use the version of the module from github.
Comment #2
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedThanks jlyon, I was a bit confused on what I should actually search for based on your comment, but I figured it out and found: #1701192: Start a 7.x-2.x branch of ctools_automodal
https://github.com/jlyon/ctools_automodal
I will test this when I get home, but I still think that the request seems to be in scope of what is provided by this module alone, or at least the portion which would simply output links in the edit and then integrate with another module possibly.
Comment #3
jlyon CreditAttribution: jlyon commentedSorry about not linking to the issue/github fork directly. I was on my phone and couldn't find it easily.
Here's an example
hook_modal_paths()
call that will work. Just update the $field_collections array with your field collection name. I agree that it would be great if field_collections added this hook so that there was integration with ctools_automodal out of the box. It could also integrate with another module like modal or directly with ctools, but that seems a little unnecessary since you would need to use a lot of the logic that ctools_automodal already has.Ways to improve this (I would be willing to work on this if there was interest):
commands_callback
entry in ctools_automodal to replace the value of the field_collections field without refreshing the entire pageComment #4
seanBApparently there is not a lot support for this, but I think it's a great idea!
Will try the automodal solution...