[6.x]: Control Panel settings form doesn't offer field toggle option
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reading the Craft 6 backend Form API and the Inertia CP Form page mentioned in the issue, then compare their field and grouping options with the previous Twig form example. Done means determining whether the API can express a lightswitch that toggles a settings group, and what change would provide that behavior if it cannot.
Written by the indexing model from the issue text.
Description
What happened?
Description
A Control Panel settings form built using Craft 6's backend Form API (CraftCms\Cms\Form\Form) and rendered through the Inertia CP Form page.
Previously:
{{ forms.lightswitchField({
label: "Enable Something",
name: 'enableSomething',
on: settings.enableSomething,
toggle: '#custom-something-settings',
}) }}
<div id="custom-something-settings" class="{{ not settings.enableSomething ? 'hidden' }}">
{{ forms.textField({
label: "Additional Setting",
name: 'additionalSetting',
value: settings.additionalSetting,
}) }}
</div>
Currently, I don't think there is an equivalent like:
Field::make('Enable Something', Lightswitch::make('settings.enableSomething')
->toggle('custom-something-settings')),
Group::make('custom-something-settings', [
Field::make('Additional Setting', Text::make('settings.additionalSetting')),
]),
Craft CMS version
6.0.0-alpha.19
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 10h 12m
- Merged PRs (30d)
- 256
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from craftcms/cms
-
[6.x]: Text in some input fields is clipped at the bottom on WindowsPossibly taken @brianjhanson claimed this 1 day ago. Openbug repo:cms
craftcms/cms#19928 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
bug repo:cms
Difficulty 4/5 3-5 days Newbie friendliness 15/100
craftcms/cms#19916 · 1 comment ·
Maintainers usually reply within 1 day
-
[6.x]: AdminTable not available for plugin index and settings screensPossibly taken @brianjhanson claimed this 2 days ago. Openbug repo:cms
craftcms/cms#19912 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
[6.x]: No way for custom element types to add top level buttons in toolbar or beside the Save menuPossibly taken @brianjhanson claimed this 1 day ago. Openbug repo:cms
Difficulty 5/5 Over a week Newbie friendliness 15/100
craftcms/cms#19910 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
[6.x] Licence nag countdown never continues to the control panel, and there's no button to skip itPossibly taken @brandonkelly claimed this 2 days ago. Openbug repo:cms
Difficulty 3/5 1-2 days Newbie friendliness 55/100
craftcms/cms#19895 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
scanaislop/aislop#476 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
components-web-app/api-components-bundle#403 ·
Maintainers usually reply within 1 day