Closed (fixed)
Project:
ImageCache
Version:
6.x-2.0-beta10
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2011 at 17:59 UTC
Updated:
2 Jun 2012 at 22:32 UTC
Hi there,
I'm in the process of theming a node using a custom template. The template is functioning perfectly and the required fields are displaying correctly. However when trying to resize an image using Imagecache, it's not working, it doesn't seem to be recognizing the image field thus not applying any changes (Cropping). If I revert back to the original node.tpl.php code, the changes are implemented just fine on said image. However, when I come to printing in the image field manually, Imagecache fails to make any changes.
For reference, I'm using the following code to print the image field. Is this an issue with Imagecache?
<?php
print theme_imagefield_image($node->field_image[0]);
?>Any help is greatly appreciated.
Comments
Comment #1
Enno commentedI believe that if you use your own custom template file you need to specify explicitly to show the image via imagecache.
Settings from the "Display fields" tab are only used if there is no custom node.tpl.php defined.
The official imagecache documentation states:
ImageCache also defines a theme function that you can use in your modules and
themes to automatically display a manipulated image. For example, to use the
theme function in a .tpl.php file, add the following line where you would like
the image to appear:
Change 'preset_namespace' to the name of your imagecache preset and make sure
that $image_filepath or some other variable contains the actual filepath to
the image you would like to display.
$alt, $title and $attributes are optional parameters that specify ALT/TITLE
text for the image element in the HTML or other attributes as specified in the
$attributes array.
Comment #2
fizk commentedPlease reopen if this is still an issue with ImageCache 6.x-2.0-rc1.