I have multifield image field, Under 'Full Content' view mode, I'd like to display all the images, but How DO I display only one image under 'Teaser' mode?.

I have read post, but i cannot implement it in my pixture_reloaded themes.

Thanks in advance

Comments

The code in the stack overflow article is fine, it does the job and you can use this in PR, add this to template.php and clear the cache:

<?php
/**
* Override or insert variables for theme_field().
*/
function pixture_reloaded_process_field(&$vars) {
 
$element = $vars['element'];
 
// Field type image
 
if ($element['#field_type'] == 'image') {
   
// Reduce number of images in teaser view mode to single image
   
if ($element['#view_mode'] == 'teaser') {
     
$item = reset($vars['items']);
     
$vars['items'] = array($item);
    }
  }
}
?>

Another way is to use the Field multiple limit module.

Much appreciated! ;) Thank you.

Issue summary:View changes

Field multiple limit is the solution to my case too, thanks for the info.
I use CKeditor the image button to add images to nodes and it worked fine on local machine. But when go on server all images added this way via CKeditor are dead. Tried pathologic to no avail. As a result have to get other way around.
Finally I upload multiple images through image field and use the module mentioned above to display only one image on teaser. Job done.
Just can't get the CKeditor to show images correctly after days of searching and investigating, so frustrated...

Status:Active» Fixed

This is a setting in Adaptivetheme, so in Pixture Reloaded theme settings you can just select it in the extensions > image settings, no need for a module. Job done.

Status:Fixed» Closed (fixed)

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