Multiple fields vs One field of each type. #15849
Replies: 2 comments
-
Hi @thisanimus, IMO the new pattern is very useful since it can help avoid redundancy and keep your field library from getting unnecessarily large. The main thing that you should be wary of is possible future deviations in field requirements. For example if you later decide that an instance of your
So, it's doable, but not so trivial that you don't think about it, and maybe a bit more complicated for matrix fields and the like. There's been a relevant FR though, that, if/when implemented, should make this a non-issue. My recommendation for now is to use the new pattern, but be a little conservative when you suspect that there may be changes to instances down the road. As for performance gains, I don't think there should be a significant difference, but I don't have evidence or the knowledge to offer real advise on this. |
Beta Was this translation helpful? Give feedback.
-
Revisiting a couple of projects I helped to migrate to Craft 5 long ago, some lessons learned: Not all query params support field instances, instead they only take the global field id into account: Unfortunately Craft does not support overwriting translation methods/use as search keywords, which in real live leads to global fields like If you start with a single site project, and add more languages later, you will have to check all field instances and assign new global fields if different field instances are to receive different translation methods. Be aware of glitches like described in #15799. Working on quite complex and constantly evolving projects, we experienced that there is a high probability that field type specific settings will become more individualized in favor of better author experience, leading to more specific global fields. So many things can change: default values, lenghts, min/max values, plain text line count, placeholder texts, size conditions for images, default upload folders, on/off labels, view modes, button labels, sources etc. etc.
In my words: be very conservative, at least until there will be better support for field instances. PS. |
Beta Was this translation helpful? Give feedback.
-
Craft 5 supports reusing fields within an entry type, and customizing handles.
In the past I would do this (we'll call this the old pattern):
youtubeUrl
vimeoUrl
Now I could potentially (we'll call this the new pattern):
shortText
shortText
to the entry type and customize the handle toyoutubeUrl
shortText
to the entry type and customize the handle tovimeoUrl
Presumably for large parts of my content model, I could just have one of each type of field; reusing them as needed.
Questions:
Beta Was this translation helpful? Give feedback.
All reactions