Skip to content
Snippets Groups Projects
Commit cfb00aca authored by Ryan Jacobs's avatar Ryan Jacobs
Browse files

Issue #2107251 by rjacobs: Add bundled 85x85 px thumbnail style for use with stock Juicebox lib.

parent b5813510
No related branches found
Tags 6.22
No related merge requests found
......@@ -124,6 +124,28 @@ function juicebox_views_plugins() {
}
/**
* Implements hook_image_default_styles().
*
* Add a default thumbnail style that will fit (without stretching or scaling)
* within the stock Juicebox thumbnail space.
*/
function juicebox_image_default_styles() {
$styles = array();
$styles['juicebox_square_thumbnail'] = array(
'label' => 'Juicebox square thumbnail (85x85)',
'effects' => array(
array(
'name' => 'image_scale_and_crop',
'data' => array('width' => 85, 'height' => 85),
'weight' => 0,
),
),
);
return $styles;
}
/**
* Instantiate a Juicebox connector object along with its dependencies.
*
......@@ -391,7 +413,7 @@ function juicebox_field_formatter_info() {
'field types' => array('image', 'file'),
'settings' => array_merge($base_settings, array(
'image_style' => '',
'thumb_style' => 'thumbnail',
'thumb_style' => 'juicebox_square_thumbnail',
'caption_source' => 'alt',
'title_source' => 'title',
)),
......
......@@ -29,7 +29,7 @@ class JuiceboxViewsStylePlugin extends views_plugin_style {
'image_field' => array('default' => ''),
'image_field_style' => array('default' => ''),
'thumb_field' => array('default' => ''),
'thumb_field_style' => array('default' => 'thumbnail'),
'thumb_field_style' => array('default' => 'juicebox_square_thumbnail'),
'title_field' => array('default' => ''),
'caption_field' => array('default' => ''),
'show_title' => array('default' => 0),
......@@ -136,7 +136,7 @@ class JuiceboxViewsStylePlugin extends views_plugin_style {
// the Juicebox-specific plugin settings (such as
// admin/structure/views/add).
if (empty($this->options['image_field'])) {
drupal_set_message(t("To ensure a fully functional Juicebox gallery please remember to add at least one image field to your Juicebox view display and configure the Juicebox Gallery format settings."), 'warning', FALSE);
drupal_set_message(t("To ensure a fully functional Juicebox gallery please remember to add at least one field of type Image or File ID to your Juicebox view display and configure the Juicebox Gallery format settings."), 'warning', FALSE);
}
return $errors;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment