You are here

slick_paragraphs.module in Slick Paragraphs 8

Same filename and directory in other branches
  1. 8.2 slick_paragraphs.module

Provides Slick integration with Paragraphs.

File

slick_paragraphs.module
View source
<?php

/**
 * @file
 * Provides Slick integration with Paragraphs.
 */

/**
 * Implements hook_field_formatter_info_alter().
 */
function slick_paragraphs_field_formatter_info_alter(array &$info) {

  // Supports Media Entity via VEM within VEF if available.
  if (function_exists('slick_media_help')) {
    $info['slick_paragraphs'] = [
      'id' => 'slick_paragraphs',
      'label' => t('Slick Paragraphs Media'),
      'description' => t('Display the referenced paragraph with ME as a Slick Carousel'),
      'class' => 'Drupal\\slick_paragraphs\\Plugin\\Field\\FieldFormatter\\SlickParagraphsFormatter',
      'field_types' => [
        'entity_reference_revisions',
      ],
      'quickedit' => [
        'editor' => 'disabled',
      ],
      'provider' => 'slick_paragraphs',
    ];
  }
}

/**
 * Implements hook_help().
 */
function slick_paragraphs_help($route_name) {
  if ($route_name == 'help.page.slick_paragraphs') {
    $output = file_get_contents(dirname(__FILE__) . '/README.md');
    return function_exists('blazy_parse_markdown') ? blazy_parse_markdown($output) : '<pre>' . $output . '</pre>';
  }
  return '';
}