- Issue created by @circuitcipher
- πΊπΈUnited States circuitcipher
I am currently working on this locally but it is dependent β¨ Replace hardcoded Media Photoswipe view mode with configurable formatter Active being merged.
- Merge request !12Issue #3539899 by circuitcipher: Fix Layout Builder compatibility for Media Gallery β (Merged) created by Unnamed author
- ivnish Kazakhstan
I think needs to add a test for this functionality (MG + LB)
- πΊπΈUnited States circuitcipher
Is this AI generated code? :D
I wish. I had to struggle a lot to to get this working :). 95% of it is my own hard work. Sometimes I ask AI how to accomplish certain tasks. On this specific PR, I had AI help me clean up the variable names in `getLayoutBuilderImagesField` to more appropriately align with the Layout Builder terminology.
I think needs to add a test for this functionality (MG + LB)
Sounds like a good idea. I will begin working on tests to cover the changes.
- πΊπΈUnited States circuitcipher
I have improved the test code coverage for the Layout builder compatibility.
@ivnish, I used xdebug code coverage to verify that the test cases were hitting all relevant code branches. While I was researching on Drupal code coverage, I saw other modules who have integrated code coverage into their pipelines. Is this something you would want to do? See example here: https://www.drupal.org/project/knowledge/issues/3526796 π Add Code Coverage Active
- ivnish Kazakhstan
I don't know about "code coverage" like here https://www.drupal.org/project/knowledge/issues/3526796 π Add Code Coverage Active
The default CI is enough for me :)
- ivnish Kazakhstan
Nice work! LGTM. I need some time for manual testing
Could you explain: I understand when gallery added to node LB as block. But what is your use case for using LB for render gallery?
- πΊπΈUnited States circuitcipher
Could you explain: I understand when gallery added to node LB as block. But what is your use case for using LB for render gallery?
The main benefit of adding Layout Builder support is flexibility for site builders and content editors. With the current approach, all media galleries of a given type share the same display configuration.
By enabling Layout Builder:
1. Site builders can adjust the gallery layout directly from Structure β Media Gallery β Manage Display, without needing custom templates or code.
2. More importantly, each media gallery instance can have its own unique layout and style when Layout Builder is enabled per-content-item. This means one gallery could use a photoswipel formatter another uses swiperjs, and another a simple listβall without creating separate content types or custom overrides.
3. This provides editors much greater control and creative freedom, and reduces the need for developer intervention when requirements change.In short, Layout Builder makes the gallery module more versatile, since galleries can be both standardized across the site and customized on a per-node basis when needed.
I personally wanted the functionality to have different gallery styles per gallery in case a future client may request it.
- πΊπΈUnited States circuitcipher
- ivnish Kazakhstan
I tested manually and don't find any problems in my existing projects
-
ivnish β
committed 19d7db03 on 3.0.x authored by
circuitcipher β
Issue #3539899 by circuitcipher: Fix Layout Builder compatibility for...
-
ivnish β
committed 19d7db03 on 3.0.x authored by
circuitcipher β
-
ivnish β
committed 9df0f288 on 3.1.x authored by
circuitcipher β
Issue #3539899 by circuitcipher: Fix Layout Builder compatibility for...
-
ivnish β
committed 9df0f288 on 3.1.x authored by
circuitcipher β
-
ivnish β
committed c2785951 on 3.0.x
Revert "Issue #3539899 by circuitcipher: Fix Layout Builder...
-
ivnish β
committed c2785951 on 3.0.x