Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[6.x]: Control Panel settings form doesn't offer field toggle option

Closed
#19,805 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
backend

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

bug repo:cms
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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from craftcms/cms

All issues in craftcms/cms

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.