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

Skip to content
Snippets Groups Projects

OEL-1394: Merge 1.x into EPIC-1293-Project, align with new version of card:search pattern

Merged Francesco SARDARA requested to merge OEL-1394 into EPIC-1293-Project
93 files
+ 5725
210
Compare changes
  • Side-by-side
  • Inline
Files
93
+ 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