Hello Folks,
I am not sure if this setting is there somewhere, but I have had hard time in displaying original images that I had uploaded for my content. I had uploaded images of 1000 X 429 for all my contents and linked them with nivo slider, there I dint find any option to display orignal image.
We have an option for the settings of Format : "View Nivo Slider", there we have Image field style option and available values are thumbnail, medium, large We don't have Original / None value there.
###I have done the following to achieve the desired resule, let me know if any better way is there or this is an issue that is there###
file - views_nivo_slider_style_plugin.inc Line #60
Replaced '#options' => $presets WITH '#options' => array_merge(array('' => t('<None>')), $presets),
then in my template.php of theme file, I have added
function MyTheme_image_style($variables) {
// Determine the dimensions of the styled image.
$dimensions = array(
'width' => $variables['width'],
'height' => $variables['height'],
);
image_style_transform_dimensions($variables['style_name'], $dimensions);
$variables['width'] = $dimensions['width'];
$variables['height'] = $dimensions['height'];
//by dharam if no style is specified i.e if none, use original
if(!empty($variables['style_name']))//else original will be used
{
// Determine the url for the styled image.
$variables['path'] = image_style_url($variables['style_name'], $variables['path']);
}
return theme('image', $variables);
}
Comments
Comment #1
xundrp commentedTry to create new custom image style on admin/config/media/image-styles. Then select newly created custom style in Format: Settings of your View. Your slider should now display images formatted according to your new style, e.g. not scaled down.