sample files from a smithsonian project

This commit is contained in:
2024-05-22 00:26:01 -04:00
commit 265541edc3
76 changed files with 2140 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
/**
* @file
* Block-related functions.
*/
use Drupal\block\Entity\Block;
/**
* Implements hook_preprocess_block().
* http://kristiankaa.dk/article/drupal8-region-specific-menu-theme-hook-suggestion
*/
function cdesai_emulsify_preprocess_block(&$variables) {
if(isset($variables['attributes']['id'])) {
$variables['content']['#attributes']['block'] = $variables['attributes']['id'];
}
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function cdesai_emulsify_theme_suggestions_menu_alter(array &$suggestions, array $variables) {
// Remove the block and replace dashes with underscores in the block ID to
// use for the hook name.
if (isset($variables['attributes']['block'])) {
$hook = str_replace(array('block-', '-'), array('', '_'), $variables['attributes']['block']);
$suggestions[] = $variables['theme_hook_original'] . '__' . $hook;
}
}