Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects

[OEL-1255] OEL-1280: Copy and rename paragraph submodule from oe_bootstrap_theme

Merged Francesco SARDARA requested to merge OEL-1280 into EPIC-OEL-1255-migrate-paragraphs
66 files
+ 4648
8
Compare changes
  • Side-by-side
  • Inline
Files
66
+ 21
0
<?php
/**
* @file
* Theme functions for paragraphs.
*/
declare(strict_types = 1);
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function oe_whitelabel_theme_suggestions_paragraph_alter(array &$suggestions, array $variables): void {
/** @var \Drupal\paragraphs\ParagraphInterface $paragraph */
$paragraph = $variables['elements']['#paragraph'];
if ($paragraph->bundle() === 'oe_content_row') {
$variant = $paragraph->get('oe_paragraphs_variant')->first()->value;
$suggestions[] = 'paragraph__' . $paragraph->bundle() . '__variant_' . $variant;
}
}
Loading