windsor icon indicating copy to clipboard operation
windsor copied to clipboard

Exclude Subfields in Blueprint

Open hartwm opened this issue 1 year ago • 0 comments

I am trying to make a form builder using tabs and I use groups so that I can use the table format and condense the options. I often find ACF fails for lack of good UI. Of course I know how I could make this work, but this package is less about how to do things and more about how to do things as efficiently and DRY. That said I don't think it's possible to exclude sub_fields or it needs more explanation. Here is my example.

fields:
  tab_base: 
      label: Base 
      type: tab 
  primary: 
    label: '' 
    type: group 
    layout: table
    sub_fields:
      required: 
        label: Required 
        type: true_false 
      label: 
        label: Label 
        type: text
        required: true
      name: 
        label: Name 
        type: text 
      placeholder: 
        label: Placeholder 
        type: text 
  options: 
    label: Options 
    type: repeater
    required: true 
    layout: table
    min: 1
    button_label: 'Add Option'
    rows_per_page: 20
    sub_fields:
      option: 
        label: Option 
        type: text   
  tab_validation: 
    label: Validation 
    type: tab 
  validation: 
    label: '' 
    type: group 
    layout: table
    sub_fields:
      min: 
        label: Min 
        type: number 
      max: 
        label: Max 
        type: number 
      regex: 
        label: Regex 
        type: text 
      mask: 
        label: Mask 
        type: text 
title: 'Form'
key: 'form_default'
position: 'acf_after_title'
hide_on_screen: 
  - the_content
location:
  -
    -
      param: post_type
      operator: '=='
      value: form   
show_in_graphql: 1 
graphql_field_name: metaForm
fields:
  form_url:
    type: url
    label: Form Endpoint 
  fields: 
    label: Fields
    aria-label: ''
    type: flexible_content 
    button_label: 'Add Field'
    layouts:
      text:
        display: 'block'
        label: Text  
        sub_fields:
          form:
            label: Form  
            type: "blueprint"
            source: "form"
            prefix: false
            prefix_label: false
            excludes: 
              - options
      select:
        display: 'block'
        label: Dropdown  
        sub_fields:
          form:
            label: Form  
            type: "blueprint"
            source: "form"
            prefix: false
            prefix_label: false 
      textarea:
        display: 'block'
        label: Message  
        sub_fields:
          form:
            label: Form  
            type: "blueprint"
            source: "form"
            prefix: false
            prefix_label: false 
            excludes: 
              - options
              - validation_regex
              - regex
              - mask

hartwm avatar Mar 18 '23 00:03 hartwm