{"id":35026506,"url":"https://github.com/greenrivers/grav-plugin-conditional-fields","last_synced_at":"2026-04-27T10:31:56.511Z","repository":{"id":133859955,"uuid":"326060475","full_name":"greenrivers/grav-plugin-conditional-fields","owner":"greenrivers","description":"Grav Conditional Fields plugin.","archived":false,"fork":false,"pushed_at":"2024-02-03T11:13:48.000Z","size":473,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-28T20:28:35.451Z","etag":null,"topics":["blueprints","gpm","grav","radio-field","yaml"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greenrivers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-01-01T21:40:46.000Z","updated_at":"2024-11-27T16:44:15.000Z","dependencies_parsed_at":"2024-02-03T12:25:19.148Z","dependency_job_id":"926a0d1a-3c86-4d4e-8a6b-69f526962d6a","html_url":"https://github.com/greenrivers/grav-plugin-conditional-fields","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/greenrivers/grav-plugin-conditional-fields","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenrivers%2Fgrav-plugin-conditional-fields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenrivers%2Fgrav-plugin-conditional-fields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenrivers%2Fgrav-plugin-conditional-fields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenrivers%2Fgrav-plugin-conditional-fields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greenrivers","download_url":"https://codeload.github.com/greenrivers/grav-plugin-conditional-fields/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenrivers%2Fgrav-plugin-conditional-fields/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32333196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blueprints","gpm","grav","radio-field","yaml"],"created_at":"2025-12-27T06:26:44.319Z","updated_at":"2026-04-27T10:31:56.375Z","avatar_url":"https://github.com/greenrivers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Greenrivers Conditional Fields Plugin\n\nThe **Conditional Fields** Plugin is an extension for [Grav CMS](http://github.com/getgrav/grav).\n\nIt allows You to create conditional fields in admin blueprints.\n\nWorks with toggle and radio field.\n\n\u003cins\u003eNot working with editor field type.\u003c/ins\u003e\n\n## Installation\n\nInstalling the Conditional Fields plugin can be done in one of three ways:\n- GPM (Grav Package Manager)\n- manual method\n- admin method\n\n### GPM Installation (Preferred)\n\nTo install the plugin via the [GPM](http://learn.getgrav.org/advanced/grav-gpm),\nthrough your system's terminal (also called the command line), navigate to the root of your Grav-installation, and enter:\n\n    bin/gpm install conditional-fields\n\nThis will install the Conditional Fields plugin into your `/user/plugins`-directory within Grav.\nIts files can be found under `/your/site/grav/user/plugins/conditional-fields`.\n\n### Manual Installation\n\nTo install the plugin manually, download the zip-version of this repository and unzip it under `/your/site/grav/user/plugins`.\nThen rename the folder to `conditional-fields`.\nYou can find these files on [GitHub](https://github.com/greenrivers/grav-plugin-conditional-fields) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras).\n\nYou should now have all the plugin files under\n\n    /your/site/grav/user/plugins/conditional-fields\n\n\u003e NOTE: This plugin is a modular component for Grav which may require other plugins to operate,\n\u003e please see its [blueprints.yaml-file on GitHub](https://github.com/greenrivers/grav-plugin-conditional-fields/blob/master/blueprints.yaml).\n\n### Admin Plugin\n\nIf you use the Admin Plugin, you can install the plugin directly by browsing the `Plugins`-menu and clicking on the `Add` button.\n\n## Configuration\n\nBefore configuring this plugin, you should copy the `user/plugins/conditional-fields/conditional-fields.yaml` to `user/config/plugins/conditional-fields.yaml` and only edit that copy.\n\nHere is the default configuration and an explanation of available options:\n\n```yaml\nenabled: true\n```\n\nNote that if you use the Admin Plugin, a file with your configuration named conditional-fields.yaml will be saved in the `user/config/plugins/`-folder once the configuration is saved in the Admin.\n\n## Usage\n\nConditional fields work by setting the appropriate classes for fields.\n\nIn Grav We have 2 properties which responsible for css classes:\n- classes\n- outerclasses\n\nSet up **outerclassess** for field which should be responsible for control show/hide.\n\n```yaml\nouterclasses: conditional condition\n```\n\nAdd classes to fields that you want to respond to the control field settings.\n\n```yaml\nouterclasses: conditional option option-X\n```\n\nWhere X have possible values depend on control field options.\n\nIf You want to toggle fieldset set up values in classes property.\n\n```yaml\nclasses: conditional option option-X\n```\n\n### Examples:\n\nToggle field with show/hide all fields.\n\n```yaml\nmysection.visibility:\n  type: toggle\n  outerclasses: conditional condition\n  label: Visibility\n  highlight: 1\n  default: 1\n  options:\n    1: Show\n    0: Hide\n  validate:\n    type: bool\nmysection.title:\n  type: text\n  label: Title\n  outerclasses: conditional option option-1\nmysection.description:\n  type: text\n  label: Description\n  outerclasses: conditional option option-1\n```\n\nToggle field with switch between fields.\n\n```yaml\nmysection.visibility:\n  type: toggle\n  outerclasses: conditional condition\n  label: Visibility\n  highlight: 1\n  default: 1\n  options:\n    1: Date\n    0: Color\n  validate:\n    type: bool\nmysection.date:\n  type: datetime\n  label: Date\n  outerclasses: conditional option option-1\nmysection.color:\n  type: colorpicker\n  label: Color\n  outerclasses: conditional option option-0\n```\n\nRadio field with switch between fieldsets.\n\n```yaml\nmysection.type:\n  type: radio\n  outerclasses: conditional condition\n  label: Type\n  default: files\n  options:\n    'files': Files\n    'pages': Pages\n    'colors': Colors\nmysection.files:\n  type: fieldset\n  title: Files\n  collapsed: true\n  collapsible: true\n  classes: conditional option option-files\n  fields:\n    mysection.files.file1:\n      type: filepicker\n      folder: 'theme@:/images/pages'\n      label: Select a first file\n      preview_images: true\n      accept:\n        - .png\n        - .jpg\n    mysection.files.file2:\n      type: filepicker\n      folder: 'theme@:/images/pages'\n      label: Select a second file\n      preview_images: true\n      accept:\n        - .png\n        - .jpg\nmysection.pages:\n  type: fieldset\n  title: Pages\n  collapsed: true\n  collapsible: true\n  classes: conditional option option-pages\n  fields:\n    mysection.pages.homepage:\n      type: pages\n      label: Homepage\n      start_route: '/home'\n      show_all: false\n      show_modular: false\n      show_root: false\n    mysection.pages.contact:\n      type: pages\n      label: Contact\n      start_route: '/contact'\n      show_all: false\n      show_modular: false\n      show_root: false\nmysection.colors:\n  type: fieldset\n  title: Colors\n  collapsed: true\n  collapsible: true\n  classes: conditional option option-colors\n  fields:\n    mysection.colors.background:\n      type: colorpicker\n      label: Background color\n    mysection.colors.text:\n      type: colorpicker\n      label: Text color\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenrivers%2Fgrav-plugin-conditional-fields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreenrivers%2Fgrav-plugin-conditional-fields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenrivers%2Fgrav-plugin-conditional-fields/lists"}