Skip to content
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

Feature request: Ability to specify schema for media assets #219

Open
mariusGundersen opened this issue Jul 11, 2024 · 0 comments
Open

Feature request: Ability to specify schema for media assets #219

mariusGundersen opened this issue Jul 11, 2024 · 0 comments

Comments

@mariusGundersen
Copy link

Currently the media plugin comes with a few hardcoded fields which cover some scenarios, but there is no way to customize it for our own usage. It's possible to fork and make changes, but it's still not easy to add custom fields as the editor needs to be customized.

My idea therefore is for the media plugin to take a list of fields, similar to how we specify the schema for any type. By default the fields would be the ones we have today (title, tags, filename, alt text and description) but it would be possible to add other fields or change the fields that are there today.

To make this possible I think the plugin should use the <FormBuilder>, same as sanity document editor uses. This way it could use all the components for editing fields as any other sanity document uses. For example we want to add a reference to another document from our assets, using the reference field that is default for references. That's not easy to do today, but given a schema with a reference field the FormBuilder would create the input field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant