-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Conditional fields #139
Comments
I think this is relevant: Sveltia CMS has already solved this problem by supporting variable types for the Object widget, not only for the List widget. I don’t have a detailed document yet, but you can use the same |
Yes, I'm familiar with this, I'm using this feature already for other collections. You are right, that this is already working from another way. I just thought the boolean + condition field would be a more intuitive solution for this particular case when I need a clear on-off state. this is the solution with the variable types. I just need to inform the client not to generate more than one news field and the problem is solved.
Recording.2024-05-10.095642.mp4 |
oh, this is much better, thanks! |
And yeah, as you said, a checkbox may be more intuitive here. I can change the UI 🙂 |
yes, but if it's only not hard to implement for you. I guess it could be simple ternary operator to the string widget and could look like:
|
You can get checkboxes with |
I think the Decap Relation widget doc mentions the I just shipped v0.26.2 to use a checkbox for optional ( |
I care a lot about the client's UX, and you make me happy! thanks! this is better now than I expected! |
Hey, @kyoshino this is a strip-down config setup to replicate the bug behaviour.
nested.fields.mp4 |
my requested optional field feature come to bite me :) edit edit: edit: I found another strange behavior with the setup below.
setup:
but when the title has i18n duplicate,
setup:
I would like to get null value when the checkbox is not selected. |
Will check. |
The fix shipped with v0.35.0 🚢 |
super, thank you very much! Will check how it works asap |
I can't find the option to make Conditional fields based of the boolean status.
The idea is to make field visibility conditional, based on other fields' values.
maybe it's here, but I can't find it.
by example:
- {label: Is News?, name: isNews, widget: boolean, default: true, i18n: duplicate}
- {label: News Description, name: newsDescription, widget: string, i18n: true}
the idea that the News Description field would be visible only when isNews boolean is true. that would give a good UX for the client to see only fields that are required for the situation. In this case, the news field would be shown if the project is news worthy,
The text was updated successfully, but these errors were encountered: