Same filename and directory in other branches
  1. 8.x-1.x colorbox_inline.module 1 comment

Enable the "colorbox inline" functionality for Drupal 8.

File

./colorbox_inline.module

View source
<?php


/**
 * @file
 * Enable the "colorbox inline" functionality for Drupal 8.
 */
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_page_attachments().
 */
function colorbox_inline_page_attachments(array &$page) {
    \Drupal::service('colorbox.attachment')->attach($page);
    $page['#attached']['library'][] = 'colorbox_inline/colorbox_inline';
}

/**
 * Implements hook_help().
 */
function colorbox_inline_help($route_name, RouteMatchInterface $route_match) {
    switch ($route_name) {
        case 'help.page.colorbox_inline':
            return t('<p>The Colorbox Inline module allows you to open content already on the page within a colorbox.</p>
<p>See the <a href=":project_page">project page on Drupal.org</a> for more details.</p>', [
                ':project_page' => 'https://www.drupal.org/project/colorbox_inline',
            ]);
    }
}

Functions

Title Deprecated Summary
colorbox_inline_help Implements hook_help().
colorbox_inline_page_attachments Implements hook_page_attachments().