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

joachim’s picture

Force the delta on the relationship to be something it can't be, like -1 maybe?

HyperGlide’s picture

Thanks 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?

joachim’s picture

Does the host entity -> FC relationship allow deltas at all?

HyperGlide’s picture

I 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.

joachim’s picture

You probably need a custom relationship handler.

HyperGlide’s picture

Hmm.. 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

joachim’s picture

You'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.

HyperGlide’s picture

Ok. Is it better perhaps to look at a way to patch the module? Or better write the relationship for this site?

Thank you.