-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group fields in JSON column #162
Comments
@nsivertsen this is a great idea! It could be packed into new 'group' field :) It would be a step towards having page/field templates (#126) |
Hi @nsivertsen, Like I just mentioned in #164, this is a great idea. We do not have the infrastructure immediately in place to be able to do that, however our blocks content works exactly like that so we should be able to leverage that part of the codebase to implement something at the module level. In the meantime that's definitely something that should be achievable through the repository. Another approach that should work for more field types would be to deconstruct the JSON into multiple Eloquent model accessors, but that would be way to much infrastructure to solve an issue that should make things simpler. |
If you are trying to render the |
Hi there!
I was wondering whether there's already some infrastructure in place to group a set of fields in a module in such a way that they are saved to one JSON column in the database, both for fields on the module itself and for fields in blocks?
The reason for doing this is that I'm using the connected fields partial to show or hide some fields based on other fields and I'd prefer not to have a database column for every possible field. Also, I can foresee adding more fields to this field group later on.
I've managed to save a set of fields to one JSON field in the database using the
prepareFieldsBeforeSave
hook the the module repository, but I'm having trouble getting them back into the form. If I add them to the$fields
array in thegetFormFields
hook they are ignored.Is there maybe a better way?
Thank you!
The text was updated successfully, but these errors were encountered: