In conjunction with #2327399: Bootstrap Carousel image field formatter (bootstrap_ux), we need to have a theme hook/template available.

Comments

markhalliwell’s picture

Title: Create a carousel theme hook » Create a bootstrap_carousel theme hook
Status: Active » Fixed
// Example usage:
  $images[] = array(
    'image' => array(
      '#theme' => 'image',
      '#path' => path_to_theme() . '/img/slide1.jpg',
    ),
    'title' => t('Slide 1'),
    'description' => t('Cras justo odio, dapibus ac facilisis in, egestas eget quam.'),
  );
  $build['carousel'] = array(
    '#theme' => 'bootstrap_carousel',
    '#items' => $images,
    '#interval' => 5000,
    '#controls' => TRUE,
    '#indicators' => TRUE,
    '#pause' => TRUE,
    '#wrap' => TRUE,
    '#attributes' => array(
      // If "id" is not set, it will default to using "carousel[-x]" as the ID.
      'id' => 'my-carousel',
      'class' => array(
        'additional-class',
      ),
    ),
  );
  print drupal_render($build);

  • Mark Carver committed fee89e5 on 7.x-3.x
    Issue #2327501 by Mark Carver: Added Create a bootstrap_carousel theme...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.