Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
In the Display Suite's documentation there's this "Code Snippets" page.
I want to use the code in the section "Limit multiple field" but it doesn't say where to put it. I'm assuming it's supposed to go into template.php of my theme. If that's the case, there might be a mistake in the dcumentation where it says:
Code underneath adds a new formatter for an imagefield which uses a custom function in a
moduletheme called 'imagecache_for_nd_contrib'.
Comments
Comment #1
goofrider CreditAttribution: goofrider commentedI also added the code to my template.php, changed all instances of 'imagecache_for_nd_contrib' to the name of my theme, but it doesn't work. No new CCK field formatter appears.
Comment #2
goofrider CreditAttribution: goofrider commentedOK I figured it out. I actually have to create a module called 'imagecache_for_nd_contrib', put the code verbatim in a file called 'imagecache_for_nd_contrib.module' and create the info file 'imagecache_for_nd_contrib.info' too.
The problem now is that the code skips all ImageCache presets, so it can limit a ImageField to a single image, but the image will have to be full-size. Is there a way to limit an imagefield to a single image and then pipe it thru an imagecache preset?