Closed (fixed)
Project:
Zoomify
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Oct 2009 at 02:31 UTC
Updated:
29 Oct 2009 at 02:14 UTC
http://drupal.org/node/371818 talks about how to make the zoomify viewer the default display when you view an image node. Our site also has nodes built with cck/Imagefield, and I wanted the same effect for those.
I chose to override theme_imagefield_formatter_image_plain from imagefield_formatter.inc, so in template.php I added:
function YourThemeNameHere_imagefield_formatter_image_plain($element) {
$node = $element['#node'];
if ( zoomify_check($node) ) {
return zoomify_display($node) ;
}
else {
return theme_imagefield_formatter_image_plain($element);
}
}
Then in my cck content type I go to the 'Display Fields', and select the 'Image' option. Instead of showing the raw image, it now shows the image inside the zoomify viewer.
Comments
Comment #1
davidhk commentedSpoke too soon! The call to theme_imagefield_formatter_image_plain results in an undefined function. I think the right way to reach it will be via the 'theme' function, but how to force that to use the original function and not the override?
As a quick fix, I just pasted in the original code from function theme_imagefield_formatter_image_plain into the else section:
Comment #2
infojunkieTry inserting
before the call to
theme_imagefield_formatter_image_plain.Comment #3
davidhk commentedThat fixes it - thanks for the help. So the working version is:
Comment #4
davidhk commented