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

Be able to save any parameter as undefined #290

Open
lorensansol opened this issue Jan 4, 2025 · 1 comment
Open

Be able to save any parameter as undefined #290

lorensansol opened this issue Jan 4, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@lorensansol
Copy link

Hello!

I use Hugo and it is common for me to use merge between different objects so that, if a parameter is not defined, it will take by default the one of the previous object with the same name.

This is useful for me in the CMS to set default values.

For this reason I need to be able to save any parameter as undefined or null, regardless of the widget type.

With Static CMS I do this through custom widgets, by adding a (x mark) type button in the corner of each widget, which allows to change the value of that parameter to undefined.

I am aware that custom widgets do not yet exist.

I wonder if it would be possible and reasonable for you to add an equivalent option, within the 3-dot menu in each widget, (for example, next to another option called Revert Changes), that would do this. It could be called Remove Value, for example.

For this it would be important not to autofill boolean fields. It seems to me that it would make more sense for this to be the case if "required": false is specified. If not, perhaps an output.booleans_default_false option would work, for example.

The output.omit_empty_optional_fields option does not work for me, as I must be able to:

  • Indicate an empty string '' in the text fields to overwrite possible upper non-empty strings.
  • Indicate false in the boolean fields to overwrite possible higher true values.
@kyoshino
Copy link
Member

kyoshino commented Jan 4, 2025

I think you need to use custom widgets also in Sveltia CMS. The support for custom widgets is coming in Q2.

@kyoshino kyoshino added the enhancement New feature or request label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants