Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment #1
swentel CreditAttribution: swentel commentedNot 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.
Comment #2
Jax CreditAttribution: Jax commentedHow 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?
Comment #3
swentel CreditAttribution: swentel commentedThat's indeed the only way it can work right now by having custom formatters.
Comment #4
swentel CreditAttribution: swentel commentedOk, this is pretty insane todo actually - added the code snippet to the snippets page http://drupal.org/node/700056
Comment #5
ball.in.th CreditAttribution: ball.in.th commentedI'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
to
And then flush the theme registry.
Comment #6
TravisCarden CreditAttribution: TravisCarden commentedSee #793656: Show only first image from multi-value imagefield (or "group multiple values").