- Issue created by @pearls
- πΊπΈUnited States apmsooner
Although the autocomplete widget makes it look like you can add more than 1 value, this isn't possible with sub-fields which is why you're only seeing 1 value saved. While a custom field at the field level can be multiple, there will ALWAYS only be a single value allowed in a sub-field. What you're trying to do here looks to be one of those edge cases where you'd want to use a regular multi-valued entity reference field type. We actually discussed this topic in the Talking Drupal episode if you want more insight around why: https://www.youtube.com/watch?v=dC5ec8FG6vQ
- πΊπΈUnited States apmsooner
BTW, what admin theme are you using and what is the version of Drupal Core you are on? The storage and widget settings sections should not be floating together like that and breaking up the table.
Ok. Thanks for support . My opinion is still that it would be better to allow Multi-value in a subfield.
For example, some scenarios might have 4-5 or more entity reference fields. CF provides a solution with a single field and responds very well by filling these fields only when needed.
This way you don't have to create a lot of entity reference field and you can use only the subfield you need when you need it.
My primary reason for choosing this module is not performance, but the efficiency and flexibility of the form/display widget options. In my tests, there's no significant performance difference between CF and Paragraph module.However, if it's limited to a single value, it's not a complete alternative to the paragraph module. If it doesn't display multiple values, you're forced to use the paragraph module or the standard entity reference field for multiple values.
For #3,
This is a test environment to demonstrate the scenario. 4 screenshots combined into 2 pictures to show the entire scenario.
I created this just to show you how it works for single-value and multi-value points. I didn't need any CSS or other settings for this.
Admin Theme: Gin
Main Theme: Olivero
Drupal 11.1.2Thanks again...
- πΊπΈUnited States apmsooner
My opinion is still that it would be better to allow Multi-value in a subfield.
It's not technically even possible due to how the data is stored. You'll notice there is no cardinality setting at the sub-field for this very reason, only single values can be stored in a table row. So, its not a choice.
Custom field is not always going to replace paragraphs or entity_reference field. If you need multi-valued entity references and don't need any other complementary fields with them, just use entity_reference. If you need multiple single value fields grouped together, use custom_field. If you need both, you can use a paragraph containing the best of both worlds: multi-valued entity_reference field + custom_field.
I can assure you there is a performance benefit with custom_field vs. multiple regular fields purely based on the fact that regular fields are all stored as individual tables. Paragraphs only compound the problem by introducing more tables and revision bloat. That being said, you have to have balance in your application based on what you need.