- Issue created by @Julien Tekrane
- Merge request !402Issue #3530141 by julien-: Allow no fields, only nested field_group. → (Open) created by Julien Tekrane
- 🇫🇷France duaelfr Montpellier, France
@julien tekrane:
Hi!
Thank you for bringing this back. I recognize a big part of your code as my own code from an old PR on github.
I have been using this for a very long time but it seem that it is not needed anymore to get nested groups working.
I removed this patch on all my projects without any difference. I guess that's because some "recent" changes in Field Group.I just pushed a tiny change in our field group formatter to ensure that
field_group_remove_empty_display_groups()
has what it needs to handle our groups. That should fix the last use cases with nested groups.Do you still have issues? Can you provide steps to reproduce on a clean install?
- 🇫🇷France Julien Tekrane
@duaelfr
I updated with 8.x-1.13 version and still have the issue.
Here is my use case (each point is a pattern) :
- field_group using pattern "Accordion"
- field_group using pattern "Accordion item"
- field_group using pattern "Description list"
- field Body
I certainly too much played with _items in my theme/templates/patterns/accordion/pattern-accordion--field-group.html.twig but have no other choice for providing by default
{%- if _items['#fields'] is not empty -%} {% set _items = _items|merge({ '#fields': _items['#fields']|merge({ 'status': _items['#fields']['status']|default(_status), 'content': _items['#fields']['content']|default(''), 'idparent': _id, 'is_copyable': _is_copyable, 'item_id': _items['#fields']['id']|default(_id ~ '-' ~ loop.index), 'loop_index': loop.index, 'open_item': _open_item_id == loop.index, 'stay_open': stay_open, 'title': _items['#fields']['title'], 'title_tag': _items['#fields']['title_tag']|default('h2') }) }) %} {%- endif -%}
I have reverted previous commit and suggest a simpler approach. Please review it. Thanks
- 🇫🇷France duaelfr Montpellier, France
@julien tekrane Would you provide me your patterns in an attached zip file so I can try to reproduce locally?