In the Display Suite's documentation there's this "Code Snippets" page.

http://drupal.org/node/700056

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 module theme called 'imagecache_for_nd_contrib'.

Comments

goofrider’s picture

Title: Where to put the code provided by the "Limit Multiple Field" sction in the "Code Snippets" page? » Code provided by the "Limit Multiple Field" sction in the "Code Snippets" page doesn''t work

I 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.

goofrider’s picture

Title: Code provided by the "Limit Multiple Field" sction in the "Code Snippets" page doesn''t work » Code provided by "Limit Multiple Field" section in the "Code Snippets" page does not use imagecache presets
Category: bug » support
Priority: Normal » Minor
Status: Active » Closed (works as designed)

OK 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?