diff --git a/field_slideshow.module b/field_slideshow.module index e3eb071..baa9def 100644 --- a/field_slideshow.module +++ b/field_slideshow.module @@ -15,6 +15,7 @@ function field_slideshow_field_formatter_info() { 'field types' => array('image', 'imagefield_crop', 'media', 'field_collection'), 'settings' => array( 'slideshow_image_style' => '', + 'slideshow_fullwidth' => 1, 'slideshow_link' => '', 'slideshow_colorbox_image_style' => '', 'slideshow_colorbox_slideshow' => '', @@ -75,7 +76,11 @@ function field_slideshow_field_formatter_settings_form($field, $instance, $view_ '#empty_option' => t('None (original image)'), '#options' => image_style_options(FALSE), ); - + $element['slideshow_fullwidth'] = array( + '#title' => t('full width'), + '#type' => 'checkbox', + '#default_value' => $settings['slideshow_fullwidth'], + ); $links = array( 'content' => t('Content'), 'file' => t('File'), @@ -572,6 +577,7 @@ function field_slideshow_field_formatter_view($entity_type, $entity, $field, $in // Needed when upgrading to 1.1 if (!isset($settings['slideshow_order'])) $settings['slideshow_order'] = ''; if (!isset($settings['slideshow_carousel_image_style'])) $settings['slideshow_carousel_image_style'] = ''; + if (!isset($settings['slideshow_fullwidth'])) $settings['slideshow_fullwidth'] = 0; if (!isset($settings['slideshow_carousel_visible'])) $settings['slideshow_carousel_visible'] = '3'; if (!isset($settings['slideshow_carousel_scroll'])) $settings['slideshow_carousel_scroll'] = '1'; if (!isset($settings['slideshow_carousel_speed'])) $settings['slideshow_carousel_speed'] = '500'; @@ -754,6 +760,7 @@ function field_slideshow_field_formatter_view($entity_type, $entity, $field, $in '#theme' => 'field_slideshow', '#items' => $items, '#image_style' => $settings['slideshow_image_style'], + '#fullwidth' => $settings['slideshow_fullwidth'], '#order' => $settings['slideshow_order'], '#controls' => ($settings['slideshow_controls'] === 1 ? $controls : array()), '#controls_position' => $settings['slideshow_controls_position'], @@ -793,6 +800,7 @@ function field_slideshow_theme() { 'variables' => array( 'items' => NULL, 'image_style' => NULL, + 'fullwidth' => NULL, 'order' => NULL, 'controls' => NULL, 'controls_pause' => NULL, @@ -895,11 +903,15 @@ function template_preprocess_field_slideshow(&$variables) { if (isset($item['width']) && isset($item['height'])) { $image['width'] = $item['width']; $image['height'] = $item['height']; + if(isset($variables['fullwidth']) ) { + $image['width'] = "100%"; + } } else { $image_dims = getimagesize($image['path']); $image['width'] = $image_dims[0]; $image['height'] = $image_dims[1]; + } if (isset($item['title']) && drupal_strlen($item['title']) > 0) $image['title'] = $item['title']; if (isset($variables['image_style']) && $variables['image_style'] != '') {