You are here

function blazy_photoswipe_preprocess_blazy in Blazy PhotoSwipe 8

Overrides variables for blazy.html.twig.

File

./blazy_photoswipe.module, line 11
Provides a simple Blazy PhotoSwipe integration.

Code

function blazy_photoswipe_preprocess_blazy(&$variables) {
  $settings = $variables['settings'];
  if (!empty($settings['media_switch']) && $settings['media_switch'] == 'photoswipe') {

    // Video's HREF points to external site, adds URL to local image.
    // Do not rely on IMG as IMG is not there when using CSS background.
    if (!empty($settings['box_url'])) {
      $variables['url_attributes']['data-box-url'] = $settings['box_url'];
    }
  }
}