4

I have a news page on my site, and I'm displaying it using Views and Display Suite so the image is along side by side to the description of the news. In Manage Display for News Content Type I want to display 1 image on the teaser view, then when the user clicks through it shows all images for that news item.

But when I set #1 in manage display, and click save, it doesn't save the setting. If I have more than 1 image for the news item, it displays all of them in the teaser when I only want to show 1. Can anyone advise?

5
  • Have you tried using fields instead of Display Suite in Views? When displaying fields, there is a "Multiple field settings" option that allows you to display just the first image, just the second image, etc. Commented Feb 5, 2013 at 10:03
  • Hi Patrick, thats almost there, its just that I wanted the image1 next to description hence reason for using display suite. Commented Feb 5, 2013 at 10:40
  • as opposed to having the image above the description on teh teaser Commented Feb 5, 2013 at 10:40
  • I've thought of a work around for this. Just add another seperate Image Field, on the teaser only show Image1, on the full content show both Image fields on left, and body on right. If no further response then assume it works ok. Commented Feb 5, 2013 at 11:31
  • If it works for you please answer the question yourself and mark the answer as accepted. On Drupal Answers, it's perfectly OK (and encouraged!) to answer your own question. Commented Feb 5, 2013 at 11:56

4 Answers 4

2

In display suite manage display, put 1 (the number of image to display) instead of #1

7
  • hi, I tried that but it created a duplicate row in the News Blog, not sure why. It only happened for the news item that had 2 images. Commented Feb 5, 2013 at 12:27
  • I Don't understand. You tried putting 1 instead of #1 on the image field in the Format column and saved. Then you got duplicated row (row = news item or image field)?
    – jramby
    Commented Feb 5, 2013 at 12:34
  • ah, with or without 1 in the field i get duplicate rows appearing as a result of having multiple images (2) for 1 of the news items. It must be my View thats causing the problem? Commented Feb 5, 2013 at 12:48
  • i must have done something silly with the View. I just created another View of content type News. Set 1 instead of #1 in Manage Display for the Image in Teaser mode , and it works perfectly. I wonder whats causing another row to get created for 2 images on 1 news item. I was messing around with Delta earlier. Commented Feb 5, 2013 at 12:55
  • i had in Views/Formats/Show/Delta Fields a delta setting as 'field_news_image' , i changed this to 'field_tags' and it works perfectly now on all Views. Many thanks for your help! Commented Feb 5, 2013 at 13:00
0

So it's not related to "display suite", it's related to "views" module. Use agregation on the view to group results by content and avoid duplicated content results.

0

The solution provided by jramby was correct, just set to 1 instead of #1 in Manage Display, and it works perfectly. The workaround I provided also works, but would recommend just setting to 1 of course.

0

Though its an old question but recently I also came a cross the similar problem, here is the module which resolved my problem: https://drupal.org/project/field_multiple_limit

From the module's project page:

This is a simple module that provides settings to limit the number of values to display on fields with multiple values.

The module extends the field display settings for fields which permit multiple values. Site administrators can specify how many values to display for each display mode (e.g. teaser). Optionally, an off-set can be specified to skip some values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.