- @grimreaper opened merge request.
- Status changed to Needs review
over 1 year ago 2:32pm 9 August 2023 - 🇫🇷France Grimreaper France 🇫🇷
Before:
After:
I will also open an issue on core or search for an existing one. Because the list is empty ok, but the block is still present.
- 🇫🇷France Grimreaper France 🇫🇷
To avoid core patch.
I will try an approach based on hook_block_access, as this is where core does its logic to not display the block when there is only one language;
- @grimreaper opened merge request.
- 🇫🇷France Grimreaper France 🇫🇷
I have created a separated MR for the approach with hook_block_access.
I discovered that hook_block_access and hook_block_build_alter are not triggered when blocks are displayed in Layout Builder.
I think having a language switcher block rendered in Layout Builder is a very rare case (at least for now) but it may exist if for example you want to administer a header or footer with an entity like Config Page or maybe you use Page Manager.
Hence 2 MR so people can choose for now.
- Issue was unassigned.
- 🇫🇷France Grimreaper France 🇫🇷
Uploading patches from MRs for easier Composer usage.
- 🇫🇷France Grimreaper France 🇫🇷
For Layout Builder block, an event subscriber listening to LayoutBuilderEvents::SECTION_COMPONENT_BUILD_RENDER_ARRAY should be implemented if needed.
Waiting for maintainers feedback.