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

Allow optional settings #113

Open
julianrubisch opened this issue Jan 22, 2025 · 0 comments
Open

Allow optional settings #113

julianrubisch opened this issue Jan 22, 2025 · 0 comments

Comments

@julianrubisch
Copy link

I wonder if there's a case to be made for settings to not have a default. Right now maglev marks these as invalid, but consider this scenario:

I have a content section with an image, which I'd like to make optional, so the user can change whether or not to add an image. If the image is omitted, the respective HTML in the template is just not rendered, which works fine.

However, I would like to leave out the default image in the yml so the section defaults to empty. It's marked as invalid in the admin interface, but works fine. I wonder if the validation rules could/should be loosened?

The canonical solution would probably be to add two separate sections (with and without image), but I feel like this would be an overdo. WDYT?

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