Posted by goofrider on March 16, 2011 at 5:19am
Jump to:
| Project: | Display suite |
| Version: | 6.x-1.4 |
| Component: | Documentation |
| Category: | support request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
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
#1
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.
#2
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?