(Ok, this is probably a very big request - or something that exists already but I don't know what it might be called.)

My request is to allow the field of a content type (at content type definition time) to potentially have many Field Collections possible to select from and be able to select which Field Collection (at content entry time) the user wants.

The real world example case is one of "product" type content.

For site that represents a catalog of products, all of those products have a large amount of content that is covered by the same fields BUT has one group of fields that is specific to that product type. Instead of creating a content type for each type of product, one creates a common content type of "product" with a field of "Specifications". That "Specifications" field has multiple Field Collections attached to it and the content contributor can chose which Field Collection specification group is appropriate at content entry time.

Comments

jschrab’s picture

So, have I asked for the "ridiculous?" :)

Actually, if anyone has "Oh, I did something similar but with a very different approach, here's how I did it" suggestions, I would be thankful.

scottrigby’s picture

RobW’s picture

I think you're looking for the Conditional Fields module. It does exactly what you describe for normal fields.

It may still have some incompatibilities with Field Collection. A good place to start if you have errors: #1582094: Incompatibility with Field collection.

As a feature request, this is probably outside of Field Collection scope. The feature doesn't have anything to do specifically with collecting fields, and already exists for every other field in the Conditional Fields module. If you agree, feel free to close.

nicolas bouteille’s picture

Issue summary: View changes

I think Node Field would be perfect here.

nicolas bouteille’s picture

Nope sorry.

Nestedbox is the better choice!
Still in sandbox state https://github.com/donquixote/drupal-nestedbox but I tested it, it works great and the code seems to be of high quality and comes from a very experienced member of the community.

nicolas bouteille’s picture

I just read my last post and I realize that I did not give enough details. Nestedbox has just a small part in all that actually. Complete solution implies using Entity Reference fields configured with the Inline Entity Form widget and use Nestedbox to create the entity bundles you want to be able to add. It's exactly the same as adding Drupal Commerce products, but instead you add custom components created from the Nestedbox entity type, that can be Slideshows, Accordions, Parallax Images, Text blocks, etc... and you can reorder them afterwards.

I just discovered a more complete module that does those three things itself : Paragraphs

donquixote’s picture

jmuzz’s picture

Status: Active » Fixed

As said in #6 paragraphs functions this way and would be a better choice for this use case.

It is not in the scope of field collection to separate the field collection fields from field collection bundles. This approach does have its own advantages. For example it is easier to aggregate data if it is always the same type, and it allows modules such as field_collection_table to work because that depends on each row having the same columns.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.