I'm using DS with view display to create an overview of all the cars in a category. Each car has un undefnined number of pictures which need to show on the detailpage of the car (node). In the listing however I only want to show a single picture but I can't seem to limit this right now? In other words, is there a way to limit the output from picture fields?

Comments

swentel’s picture

Project: Display Suite » Node displays contributions
Version: 6.x-1.1 » 6.x-2.x-dev
Component: User interface » ND CCK
Category: support » feature

Not yet - I've had this request before see #763344: Ubercart product images for helping formatters - there is no way right now limit this by default - DS 1.2 will have support for views fields but I need to find a way to have that same limiting options by default in our interface, for all CCK fields. Moving to right queue and marking as feature request.

Jax’s picture

How do you currently solve this problem on your sites? In the linked issue there is talk about using a custom formatter function. Is that the recommended way to solve this problem currently?

swentel’s picture

That's indeed the only way it can work right now by having custom formatters.

swentel’s picture

Status: Active » Closed (works as designed)

Ok, this is pretty insane todo actually - added the code snippet to the snippets page http://drupal.org/node/700056

ball.in.th’s picture

I've found a quick workaround to show only the first value of any cck fields in teasers.

With Node displays contributions module:
Copy sites/all/modules/nd_contrib/nd_cck/nd_cck.tpl.php to your theme directory, if it doesn't already exist.
Without Node displays contributions module (plain CCK module):
Copy sites/all/modules/cck/theme/content-field.tpl.php to your theme directory, if it doesn't already exist.

Then edit the copied file in your theme directory, change from

$count++;

to

$count++; if ($teaser) { break; }

And then flush the theme registry.

TravisCarden’s picture

Status: Closed (works as designed) » Closed (duplicate)