You are here

function printable_theme_suggestions_alter in Printer and PDF versions for Drupal 8+ 2.x

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

Implements hook_theme_suggestions_alter().

File

./printable.module, line 309
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);
}