You are here

colorbox.api.php in Colorbox 8

Same filename and directory in other branches
  1. 6 colorbox.api.php
  2. 7.2 colorbox.api.php
  3. 7 colorbox.api.php

API documentation for the colorbox module.

File

colorbox.api.php
View source
<?php

/**
 * @file
 * API documentation for the colorbox module.
 */

/**
 * Allows to override Colorbox settings and style.
 *
 * Implements hook_colorbox_settings_alter().
 *
 * @param array $settings
 *   An associative array of Colorbox settings. See the.
 * @param string $style
 *   The name of the active style plugin. If $style is 'none', no Colorbox
 *   theme will be loaded.
 *
 * @link
 *    http://colorpowered.com/colorbox/ Colorbox documentation.
 * @endlink
 *   for the full list of supported parameters.
 *
 * @codingStandardsIgnoreStart
 */
function hook_colorbox_settings_alter(&$settings, &$style) {

  // @codingStandardsIgnoreEnd
  // Disable automatic downscaling of images to maxWidth/maxHeight size.
  $settings['scalePhotos'] = FALSE;

  // Use custom style plugin specifically for node/123.
  if (current_path() == 'node/123') {
    $style = 'mystyle';
  }
}

Functions

Namesort descending Description
hook_colorbox_settings_alter Allows to override Colorbox settings and style.