Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentedThe 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:
Comment #2
Mark Vincent Verallo CreditAttribution: Mark Vincent Verallo commentedAnother way is to use the Field multiple limit module.
Comment #3
kopeboy CreditAttribution: kopeboy commentedMuch appreciated! ;) Thank you.
Comment #4
Stone Liu CreditAttribution: Stone Liu commentedField 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...
Comment #5
Jeff Burnz CreditAttribution: Jeff Burnz commentedThis 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.
Comment #7
hitech3273 CreditAttribution: hitech3273 commented#2 thank it works for me in Drupal 7.52
Comment #8
AmazingFork CreditAttribution: AmazingFork as a volunteer commentedIn Drupal 8, you can go to views, frontpage (example), and edit. Format = Grid & Show Fields, then under fields add image and title. Click on image, it pops up a window, look for "Multiple field settings", change value to 1. Save everything. This will set your content to show on the front page, in a grid, with a title and only 1 image, instead of displaying say 10 images all at once. This can be modified in a variety of ways but the general concept is there.
Comment #9
raffi CreditAttribution: raffi as a volunteer commented#1 for drupal 8 the following worked for me:
Preprocess instead of process.