You are here

galleryformatter.module in Gallery formatter 8

Same filename and directory in other branches
  1. 6 galleryformatter.module
  2. 7 galleryformatter.module

File

galleryformatter.module
View source
<?php

/**
 * Implementation of hook_theme().
 */
function galleryformatter_theme() {
  return [
    'galleryformatter' => [
      'variables' => [
        'slides' => NULL,
        'thumbs' => NULL,
        'settings' => NULL,
        'dimensions' => NULL,
      ],
    ],
  ];
}

/**
 * Prepares variables for galleryformatter templates.
 *
 * Default template: galleryformatter.html.twig.
 *
 * @param array $variables
 *   An associative array containing:
 */
function galleryformatter_preprocess_galleryformatter(&$variables) {

  // @TODO Provide a unique hash for each slide

  //foreach ($variables['slides'] as $key => $item) {

  //  $values = $item['#item']->getValue();

  //}
  $variables['#attached']['library'][] = 'galleryformatter/galleryformatter';
}

Functions

Namesort descending Description
galleryformatter_preprocess_galleryformatter Prepares variables for galleryformatter templates.
galleryformatter_theme Implementation of hook_theme().