{"action":"created","issue":{"url":"https://api.github.com/repos/SjonHortensius/pfsense/issues/21","labels_url":"https://api.github.com/repos/SjonHortensius/pfsense/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/SjonHortensius/pfsense/issues/21/comments","events_url":"https://api.github.com/repos/SjonHortensius/pfsense/issues/21/events","html_url":"https://github.com/SjonHortensius/pfsense/issues/21","id":60265975,"number":21,"title":"`data-toggle` to Hide Section or Group","user":{"login":"psophis","id":1141680,"avatar_url":"https://avatars.githubusercontent.com/u/1141680?v=3","gravatar_id":"","url":"https://api.github.com/users/psophis","html_url":"https://github.com/psophis","followers_url":"https://api.github.com/users/psophis/followers","following_url":"https://api.github.com/users/psophis/following{/other_user}","gists_url":"https://api.github.com/users/psophis/gists{/gist_id}","starred_url":"https://api.github.com/users/psophis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psophis/subscriptions","organizations_url":"https://api.github.com/users/psophis/orgs","repos_url":"https://api.github.com/users/psophis/repos","events_url":"https://api.github.com/users/psophis/events{/privacy}","received_events_url":"https://api.github.com/users/psophis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-08T17:11:59Z","updated_at":"2015-03-08T17:22:05Z","closed_at":null,"body":"Need a way to use the attribute `data-toggle` to hide a `Form_Group` or `Form_Section`."},"comment":{"url":"https://api.github.com/repos/SjonHortensius/pfsense/issues/comments/77762542","html_url":"https://github.com/SjonHortensius/pfsense/issues/21#issuecomment-77762542","issue_url":"https://api.github.com/repos/SjonHortensius/pfsense/issues/21","id":77762542,"user":{"login":"SanderVanLeeuwen","id":1685007,"avatar_url":"https://avatars.githubusercontent.com/u/1685007?v=3","gravatar_id":"","url":"https://api.github.com/users/SanderVanLeeuwen","html_url":"https://github.com/SanderVanLeeuwen","followers_url":"https://api.github.com/users/SanderVanLeeuwen/followers","following_url":"https://api.github.com/users/SanderVanLeeuwen/following{/other_user}","gists_url":"https://api.github.com/users/SanderVanLeeuwen/gists{/gist_id}","starred_url":"https://api.github.com/users/SanderVanLeeuwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SanderVanLeeuwen/subscriptions","organizations_url":"https://api.github.com/users/SanderVanLeeuwen/orgs","repos_url":"https://api.github.com/users/SanderVanLeeuwen/repos","events_url":"https://api.github.com/users/SanderVanLeeuwen/events{/privacy}","received_events_url":"https://api.github.com/users/SanderVanLeeuwen/received_events","type":"User","site_admin":false},"created_at":"2015-03-08T17:22:05Z","updated_at":"2015-03-08T17:22:05Z","body":"You can manually create a group and add the relevant classes:\r\n\r\n```\r\n$section->addInput(new Form_Checkbox(\r\n    '...'\r\n))->setAttribute('data-toggle', 'collapse')->setAttribute('data-target', '.toggle-input_name');\r\n\r\n$group = new Form_Group('');\r\n$group->addClass('toggle-input_name');\r\n\r\nif (empty($pconfig['input_name_enable']))\r\n\t$group->addClass('collapse');\r\n\r\n$group->add(new Form_Input(\r\n\t'...'\r\n));\r\n\r\n$section->add($group);\r\n```\r\nIt's probably better to create an helper on the section which accepts a toggle attribute and assigns it to the relevant groups and inputs, but I'll leve it to @SjonHortensius to tackle that ;)"}}