- Issue created by @mortona2k
- πΊπΈUnited States mortona2k Seattle
I'm not sure how to implement this.
I started with a HOOK_field_group_pre_render_alter(). $element['component'] is available to populate, and I can get it to load the preprocess file for the groupname. But I think it should also look for files for each field, so it can work like the field preprocessor, but for the groups props/slots.
- π¨π¦Canada ksere Montreal
This is a good idea since field_group is a popular module and is used often with SDC.
I'll continue off what you started and perform some tests.
- π¨π¦Canada ksere Montreal
Took a look, tested it, and I think what was done was already sufficient.
When choosing to render a field group as a component, I don't think we need to look for files for each field. This is because the group as a whole will be rendered as the component, and all needed preprocessing should be able to be achieved within the one file. In the loaded file we'll have access to all props and slots for the given group.
Did you think of a use case where individual files would be needed? I might be missing something.
- πΊπΈUnited States mortona2k Seattle
I'm a little fuzzy on this from when I last looked at it, it's possible I overlooked how it's supposed to work. I'll have to look into this closer next time I encounter the issue.
- Status changed to Needs review
10 months ago 1:01pm 31 March 2024 - π¨π¦Canada ksere Montreal
That's fine! I've gone ahead and opened a merge request with the work done so far. I think it's a good first version to at least support field group integration.
- Status changed to Fixed
10 months ago 11:07am 4 April 2024 - Status changed to Fixed
10 months ago 11:10am 4 April 2024 - π¨π¦Canada ksere Montreal
Good to go in release
1.0.0-alpha2
.We can open a new issue if what was discussed in #2 & #4 becomes a need down the line.