Skip to content

Instantly share code, notes, and snippets.

@Tdnshah
Tdnshah / cohesion-cannot-redeclare-component-build-library.patch
Created August 1, 2022 20:12
Acquia CMS fix to cohesion module error of duplicate function declaration.
diff --git a/modules/cohesion_elements/cohesion_elements.module b/modules/cohesion_elements/cohesion_elements.module
index 8e0caa5..633a19e 100644
--- a/modules/cohesion_elements/cohesion_elements.module
+++ b/modules/cohesion_elements/cohesion_elements.module
@@ -110,10 +110,10 @@ function cohesion_elements_library_info_alter(&$libraries, $extension) {
$library_id = 'custom-component-' . str_replace('_', '-', $id);
// Build the library
if (!empty($component['css'])) {
- $libraries[$library_id]['css']['component'] = _component_build_library($component['css'], $component['subpath']);
+ $libraries[$library_id]['css']['component'] = _cohesion_elements_component_build_library($component['css'], $component['subpath']);
@Tdnshah
Tdnshah / Blocks.md
Created February 11, 2022 21:53 — forked from bdlangton/Blocks.md
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');