- Issue created by @Anybody
- π©πͺGermany Anybody Porta Westfalica
Perhaps
/** * Alter the Layout Paragraphs builder. * * Implements hook_preprocess_HOOK(). * * @param array $variables * The variables being passed to the template. * * @see \Drupal\layout_paragraphs\Element\LayoutParagraphsBuilder::preRender() */ function hook_preprocess_layout_paragraphs_builder(array &$variables) { // Make custom alterations to the Layout Paragraphs Builder. }
can be used for this case? Or is it too wide?
We for example need a hook to attack a further library to the "Choose a component" form.
- π©πͺGermany Anybody Porta Westfalica
Okay, that works (so far). But I'm still not sure, it's perfectly fine.
Here's the code, if it helps anyone:
/** * Implements hook_preprocess_layout_paragraphs_builder(). */ function drowl_paragraphs_preprocess_layout_paragraphs_builder(array &$variables) { // Add backend library form to layout_paragraphs builder form. $variables['#attached']['library'][] = 'drowl_paragraphs/admin'; }
from π Library / style drowl_paragraphs/admin missing on "Choose a component" form / modal Fixed
- π©πͺGermany Anybody Porta Westfalica
Let's change this into a support request until we're sure, it's not expected this way.
- π©πͺGermany Anybody Porta Westfalica
Seems I was wrong and the library was just loaded as a side effect of a different hook. So back to Bug report!
- π©πͺGermany Anybody Porta Westfalica
Okay let's clarify the title! While there is a hook for the component form, there doesn't seem to be any way to alter / attach to the component select form.
As written above, we need to attach a library for that selection, but it doesn't seem to be possible.
- π©πͺGermany Anybody Porta Westfalica
This is blocking π Paragraphs Settings style broken (since Claro/Gin update?) Fixed
- πΊπΈUnited States swilmes
Attaching a patch to create a hook, as I needed the functionality as well. In our case we have a "Tab" layout paragraph that lives inside "Tabs" but "Tab" shouldn't be able to be chosen from the initial list. This hook allows us to remove that.
- Status changed to Needs review
6 months ago 9:08pm 15 May 2024 - last update
6 months ago 55 pass - last update
6 months ago 55 pass - πΊπΈUnited States swilmes
Adding a new patch that also creates the API documentation for the hook.