Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude Subfields in Blueprint #25

Open
hartwm opened this issue Mar 18, 2023 · 0 comments
Open

Exclude Subfields in Blueprint #25

hartwm opened this issue Mar 18, 2023 · 0 comments

Comments

@hartwm
Copy link

hartwm commented Mar 18, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant