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

fieldset inside list field doesn't save #1225

Closed
dimitrilongo opened this issue Sep 15, 2017 · 3 comments
Closed

fieldset inside list field doesn't save #1225

dimitrilongo opened this issue Sep 15, 2017 · 3 comments
Assignees
Labels

Comments

@dimitrilongo
Copy link

dimitrilongo commented Sep 15, 2017

It seems fieldset inside list field doesn't save data
maybe related to getgrav/grav-plugin-form#189

this is my test yaml

header.gridstack_items:
    name: items
    type: list
    label: THEME_DIM_ITEMS
    help: THEME_DIM_ITEMS_HELP
    fields:
      .column_content:
        type: fieldset
        title: THEME_DIM_COLUMNS
        help: THEME_DIM_CONTENT_COLUMNS_HELP
        info: THEME_DIM_CONTENT_COLUMNS_INFO
        text: THEME_DIM_CONTENT_COLUMNS_TEXT
        icon: th
        collapsed: true     # Initial state of fieldset (see collapsible option)
        collapsible: true    # Whether one can expand the fieldset or not
        fields:
          .column_small:
             type: select
             label: THEME_DIM_PHONE_SMARTPHONE
             description: THEME_DIM_PHONE_SMARTPHONE_DESCRIPTION
             options:
                '1': THEME_DIM_ONE
                '2': THEME_DIM_TWO
                '3': THEME_DIM_THREE
                '4': THEME_DIM_FOUR
          .column_medium:
             type: select
             label: THEME_DIM_PHONE_TABLET
             description: THEME_DIM_PHONE_TABLET_DESCRIPTION
             options:
                '1': THEME_DIM_ONE
                '2': THEME_DIM_TWO
                '3': THEME_DIM_THREE
                '4': THEME_DIM_FOUR
@dimitrilongo dimitrilongo changed the title fielset inside list field doesn't save fieldset inside list field doesn't save Sep 15, 2017
@rhukster
Copy link
Member

A list is a special beast.. you can't add complex field types like columns/fieldsets etc inside a list. The JS is expecting list items to be directly under it.

@w00fz
Copy link
Member

w00fz commented Sep 26, 2017

This was an issue with the twig itself of the fieldset field. Apparently this is not such a commonly used field because it was still using old code prior to the revamp of the list field which allows any field to work within it.
Fieldset was never updated to work with that. Took me quite a long time to figure this out but should be good to go now!

@dimitrilongo
Copy link
Author

@w00fz @rhukster Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants