Rename and re-organise custom modules
- Rename `opd_talks` to `opdavies_talks` - Rename `custom` to `opdavies_blog`
This commit is contained in:
parent
e4e898f22c
commit
9b1a8fb3be
53 changed files with 125 additions and 116 deletions
18
web/modules/custom/opdavies_blog/hooks/preprocess/block.inc
Normal file
18
web/modules/custom/opdavies_blog/hooks/preprocess/block.inc
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Block preprocess hooks.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Implements hook_preprocess_HOOK().
|
||||
*/
|
||||
function opdavies_blog_preprocess_block(array &$variables): void {
|
||||
// Add the 'markup' class to blocks.
|
||||
if (in_array($variables['plugin_id'], ['views_block:featured_blog_posts-block_1'])) {
|
||||
$variables['attributes']['class'][] = 'markup';
|
||||
}
|
||||
}
|
21
web/modules/custom/opdavies_blog/hooks/preprocess/node.inc
Normal file
21
web/modules/custom/opdavies_blog/hooks/preprocess/node.inc
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Node preprocess functions.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Implements hook_preprocess_HOOK().
|
||||
*/
|
||||
function opdavies_blog_preprocess_node(array &$variables): void {
|
||||
if (!method_exists($variables['node'], 'getExternalLink')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($link = $variables['node']->getExternalLink()) {
|
||||
$variables['url'] = $link['uri'];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue