hero_video-8.x-1.x-dev/hero_video.module

hero_video.module
<?php

/**
 * @file
 * Contains hero_video.module.
 */

use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function hero_video_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    // Main module help for the hero_video module.
    case 'help.page.hero_video':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('Hero Video, Image, and/or Text') . '</p>';
      return $output;

    default:
  }
}

/**
 * Implements hook_preprocess().
 */
function hero_video_preprocess(&$variables, $hook, &$info) {
  if ($hook == 'node' && $variables['node']->bundle() == 'hero_video'
        && ($variables['view_mode'] == 'full' || $variables['view_mode'] == 'default')) {
      $theme_path = drupal_get_path('module', 'hero_video');
      $variables['directory'] = $theme_path;
      $info['theme path'] = $theme_path;
      $info['path'] = drupal_get_path('module', 'hero_video') . '/templates';
      $info['template'] = 'hero-video';
  }
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc