- π³πΏNew Zealand danielveza Brisbane, AU
Reviewing the comments in this thread and having a look at some contrib, it looks like there is already a way to do this.
Comments from larowlan in #6 are correct in that you can just use hook_element_info_alter()
larowlan
But if you just want to attach them to layout builder you should use the hook_element_info_alter hook and add an extra process callback for the layout builder render element and attach it in thatlarowlan
IE there already a hookfunction epa_layouts_element_info_alter(array &$types) { if (isset($types['layout_builder'])) { $types['layout_builder']['#attached']['library'][] = 'epa_layouts/epa_layouts'; } }
I think this can be closed?
- Status changed to Closed: works as designed
8 months ago 10:21pm 21 April 2024 - π³πΏNew Zealand danielveza Brisbane, AU
No further updates in 3 months, examples have been provided on how to do this. I'm now marking this issue as closed.
Thanks!