function opigno_certificate_theme_suggestions_opigno_certificate in Opigno certificate 3.x
Same name and namespace in other branches
- 8 opigno_certificate.module \opigno_certificate_theme_suggestions_opigno_certificate()
Implements hook_theme_suggestions_HOOK().
File
- ./
opigno_certificate.module, line 202 - Contains opigno_certificate.module.
Code
function opigno_certificate_theme_suggestions_opigno_certificate(array $variables) {
$suggestions = [];
/** @var \Drupal\opigno_certificate\OpignoCertificateInterface $opigno_certificate */
$opigno_certificate = $variables['elements']['#opigno_certificate'];
$view_mode = $variables['elements']['#view_mode'];
if ($view_mode == 'default') {
$view_mode = 'full';
}
$sanitized_view_mode = strtr($view_mode, '.', '_');
$suggestions[] = 'opigno_certificate__' . $sanitized_view_mode;
$suggestions[] = 'opigno_certificate__' . $opigno_certificate
->bundle();
$suggestions[] = 'opigno_certificate__' . $opigno_certificate
->bundle() . '__' . $sanitized_view_mode;
$suggestions[] = 'opigno_certificate__' . $opigno_certificate
->id();
$suggestions[] = 'opigno_certificate__' . $opigno_certificate
->id() . '__' . $sanitized_view_mode;
return $suggestions;
}