0

Goal: For a multiple-value field, display only the first n (e.g. the first 3) field items.

E.g. only the first 3 of 10 images in an image field.

I realize this is possibly by writing a custom field formatter. But I wonder if there is an existing solution available. Also to mix this up with existing formatters.

Hint: I use Display Suite, so solutions which involve that are welcome.

  • 1
    I dont have time to go into an answer but I can give a quick suggestion. You can create a view filter by content id in the url and display the first 3 images using views. Then create a display suite dynamic field and you can pull in that view block as if it was a field. – chadpeppers May 27 '14 at 3:48
  • True. It always appears overkill to use Views for this, but it might indeed be the best solution. – donquixote May 27 '14 at 7:18
3

There is a setting how many items to display in Display Suite. The setting is demoed in this screencast: http://youtu.be/fa56OZcJq-4?t=1m20s

|improve this answer|||||
  • Wow, this is awesome! How did I miss it? – donquixote May 27 '14 at 14:28
2

If you are using Manage Display to display fields, you can try out Field multiple limit

UI example

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.

|improve this answer|||||
  • I am going with the solution mentioned by Pontus Nilsson. But this is a legit and useful answer nevertheless. Thanks! – donquixote May 27 '14 at 14:31
1

Specifically for images there's the Image Delta Formatter module

This module provides a custom formatter for imagefields, that allows the user to specify which values (deltas) should be displayed.

|improve this answer|||||
  • I am going with the solution mentioned by Pontus Nilsson. But maybe this will be useful for me or other visitors in the future. Thanks! – donquixote May 27 '14 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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