You are here

function _jcarousel_help_views in jCarousel 8.4

Same name and namespace in other branches
  1. 8.5 jcarousel.module \_jcarousel_help_views()

Views integration hook_help() helper.

1 call to _jcarousel_help_views()
jcarousel_help in ./jcarousel.module
Implements hook_help().

File

./jcarousel.module, line 342
Provides integration with 3rd party modules and the jCarousel library.

Code

function _jcarousel_help_views() {
  $module_handler = \Drupal::moduleHandler();
  $build = [];
  $build[] = [
    '#type' => 'html_tag',
    '#tag' => 'h2',
    '#value' => t('Views integration'),
  ];
  $views_description_start = t('Most configuration options for the jCarousel module are provided through <a href=":views">Views module</a>.', [
    ':views' => $module_handler
      ->moduleExists('views') ? Url::fromRoute('help.page', [
      'name' => 'views',
    ])
      ->toString() : '#',
  ]);
  $views_description_start_details = '';
  if ($module_handler
    ->moduleExists('views_ui')) {
    $views_description_start_details = t('You may configure a new view through the <a href=":views-url">Views module interface</a>. After adding a new view, change its "Display style" to "jCarousel" and configure the remaining options there. When using the jCarousel display style with Views, you can construct any of the examples on this page as well as dynamically loaded carousels through AJAX requests.', [
      ':views-url' => url::fromRoute('entity.view.collection')
        ->toString(),
    ]);
    $views_description_start_details .= '' . t('For AJAX enabled views please use special jCarousel pager that supports page preload currectly.');
  }
  elseif ($module_handler
    ->moduleExists('views')) {
    $views_description_start_details = t('This site not have Views (or the Views UI module) installed currently. You may be able to turn on this module under your site\'s <a href="!modules-url">module page</a>, or you may have to <a href=":module">download Views module</a> and install it.', [
      ':modules-url' => Url::fromRoute('system.modules_list')
        ->toString(),
    ]);
  }
  $build[] = [
    '#type' => 'html_tag',
    '#tag' => 'p',
    '#value' => $views_description_start . ' ' . $views_description_start_details,
  ];
  return $build;
}