bear_paragraph_text_and_image.module in Bear 8
Same filename and directory in other branches
Customizations related to the Text and Image paragraph bundle.
File
modules/custom/bear_paragraph_text_and_image/bear_paragraph_text_and_image.moduleView source
<?php
/**
* @file
* Customizations related to the Text and Image paragraph bundle.
*/
/**
* Implements hook_theme().
*/
function bear_paragraph_text_and_image_theme($existing, $type, $theme, $path) {
return [
'paragraph__text_and_image' => [
'base hook' => 'paragraph',
],
];
}
/**
* Implements hook_preprocess_HOOK().
*/
function bear_paragraph_text_and_image_preprocess_paragraph__text_and_image(&$variables) {
$fields = $variables['paragraph']
->getFields();
$image_position = $fields['field_text_and_image__position']
->getValue();
$image_position = $image_position[0]['value'];
$variables['image_position'] = $image_position;
}
Functions
Name | Description |
---|---|
bear_paragraph_text_and_image_preprocess_paragraph__text_and_image | Implements hook_preprocess_HOOK(). |
bear_paragraph_text_and_image_theme | Implements hook_theme(). |