You are here

function printable_theme_suggestions_alter in Printer and PDF versions for Drupal 8+ 8

Same name and namespace in other branches
  1. 2.x printable.module \printable_theme_suggestions_alter()

Implements hook_theme_suggestions_alter().

File

./printable.module, line 312
Provides printer friendly content entities.

Code

function printable_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
  if (!printable_preparing_content()) {
    return;
  }
  $additions = [];
  for ($i = 0; $i < count($suggestions); $i++) {
    $additions[$i] = 'printable__' . $suggestions[$i];
  }

  // Prioritise the printable suggestions over normal ones.
  $suggestions = array_merge($suggestions, $additions);
}