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

[4.x] Feature: Add inline label for Toggle when truthy #8814

Merged

Conversation

caseydwyer
Copy link
Contributor

This PR adds an optional inline_label_when_true field to the Toggle fieldtype's config, allowing for a separate inline label when the value of the Toggle is truthy. This is non-breaking/backwards compatible, as the existing inline_label is unchanged and used as the fallback within the Vue component. Here's what this change looks like, in each possible scenario:

dynamic-toggle-kitchen-sink

New computed `inlineLabel` property; used in both the `v-if` and `v-html` value. Falls back to `config.inline_label`, in both `true` and `false` states.
New helper text for `toggle.config.inline_label_when_true`.
New config field to supplement `inline_label`, when value is true.
@jasonvarga jasonvarga merged commit e8344d8 into statamic:4.x Oct 6, 2023
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

Successfully merging this pull request may close these issues.

2 participants