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 would like a way to limit the "Field Collections" rendered for editing to only show the newest of "empty" collection that a user can create.
currently it is showing all the "Field Collections" on the entity.
Is this possible?
Thank you.
Comments
Comment #1
joachim CreditAttribution: joachim commentedForce the delta on the relationship to be something it can't be, like -1 maybe?
Comment #2
HyperGlide CreditAttribution: HyperGlide commentedThanks for the suggestion.
I don't have a "delta" that I can modify to -1.
The FC is on an commerce_order entity. I have tried building the view both as a "collection" and as a "order"
Either way I can adjust the "SHOWMULTIPLE FIELD SETTINGS" in the filed setting for that field. However it only impacts the displayed values and not the "editable" tab.
The "editable table" seems to always render no matter what setting i put for the pager, filter, or SHOWMULTIPLE FIELD SETTINGS.
Other ideas or suggestions please?
Comment #3
joachim CreditAttribution: joachim commentedDoes the host entity -> FC relationship allow deltas at all?
Comment #4
HyperGlide CreditAttribution: HyperGlide commentedI was able to add the "relationship and add each field in the FC separately.
Before I was just adding the (1) field collect_field.
There I get a Delta. If i Set to (1) I get the oldest FC.
I don't have a choice for a -1?
I tried to export the view and manually code to -1 to changes to "all' on import.
The desired is to have a new empty FC so a user can add a value to the Entity.
Comment #5
joachim CreditAttribution: joachim commentedYou probably need a custom relationship handler.
Comment #6
HyperGlide CreditAttribution: HyperGlide commentedHmm.. how do I do that? A bit beyond my skill set.
Is this a valid example?
http://drupal.stackexchange.com/questions/4100/views-3-relationship-handler
Comment #7
joachim CreditAttribution: joachim commentedYou'd need a custom class - that just shows you how to define a new relationship.
Ideally, this would be generalized in our views data hook to all relationships that use a delta (or indeed, all relationships that connect entities) to force an empty relationship.
Comment #8
HyperGlide CreditAttribution: HyperGlide commentedOk. Is it better perhaps to look at a way to patch the module? Or better write the relationship for this site?
Thank you.