Allow functions for relationTo, maxRows, etc. #10776
n-a-t-j-b
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi team, are there any plans to allow additional config properties to be functions? Our primary concerns are with relationTo and maxRows but there may be other edge cases e.g. max/min, readOnly etc. Not looking to change the nature of the field as the function should still have to resolve to a valid typed value.
Our need for a dynamic relationTo - so that our Author field value can determine which upload collection to assign to an images field.
Our maxRows use case: resolves to 10 or 1 for that same images field, based on our Author field relationTo value.
Full scenario and solution today:
Our current options (ones we've evaluated at least):
Either way, not ideal, whereas a single images field (like our author field) would definitely simplify logic and reduce the need for additional db storage.
Would love some feedback on this - if there's currently an alternate way to do what we need or even just better logic to deal with our use case.
Cheers, Nat.
Edit: initial post suggested hasMany but given that would change the item structure from a single object to an array, we've resolved to use maxRows instead with a practical limit for both collections.
Beta Was this translation helpful? Give feedback.
All reactions