getgrav / getgrav/grav-plugin-admin

Conditionally show form fields

Open
#751 6 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
PHP
Stars
377
Forks
225
Avg merge
11h 51m
Merged PRs (30d)
4

Description

The WordPress plugin [Advanced custom fields](https://www.advancedcustomfields.com/) has a really nice feature called _Conditional logic_. Essentially, what this does is it lets the theme developer specify a condition under which fields should be shown/hidden. This is really powerful when you have a list field where the different entries can be of different types (eg. text/image). When the content author specifies that an entry has the image type, I might want to show a `pagemediaselect` control, and when it's a text entry, I might want to show a `textarea`.

Implementation-wise, this should only be a front-end concern for the admin panel. As for how to configure it, a common blueprint field property that specifies a target field and a desired value should hopefully be enough.

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests. Start by locating the admin panel's field rendering and blueprint field-property handling, then trace how a target field and desired value could be configured. Done means fields are shown or hidden in the admin UI according to the configured condition, including fields inside list entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.