Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Refer to the current item in blueprints list for conditionnal field

Started by Benjam 7 years ago · 0 replies · 308 views
7 years ago

Hello People,

i'm wondering how to refer to the current item in a blueprint list for a conditional field ?

here is my code ;

YAML
extends@: default

form:
  fields:
    tabs:
      fields:
        content:
          fields:

            partenaires:
              type: section
              title: Partenaires
              underline: true
              fields:
                header.partenaires:
                  name: Partenaires
                  type: list
                  label: Liste des partenaires
                  btnLabel: Ajouter un partenaire
                  fields:
                    .image:
                      type: pagemediaselect
                      label: Image
                      preview_images: true
                    .name:
                      type: text
                      label: Titre
                    .description:
                      type: textarea
                      label: Description
                    .url:
                      type: text
                      label: Url
                      validate:
                        type: url
                    .location:
                      type: toggle
                      label: Location
                      highlight: 1
                      default: 0
                      options:
                        1: Activé
                        0: Désactivé
                      validate:
                        type: bool
                    .is_location:
                      type: conditionnal
                      condition: "page.header.partenaires.location.enabled ? 'true' : 'false'"
                      fields:
                        .date:
                          type: datetime
                          label: Date de fin de location**strong text**
last edited 04/27/19 by Benjam

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 9 hours ago
General · by pamtbaau, 14 hours ago
1 51 14 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago