By TGReaver on
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 my custom node template thus not applying any changes. If I revert back to the original node.tpl.php code, the changes are implemented just fine on said image.
Do I need to include something in my template.php file? Tweak Imagecache? I'm slightly confused.
Any help is greatly appreciated.
Comments
Suggested path to troubleshoot
"If I revert back to the original node.tpl.php code..."
I assume that when you revert back to the code, but within the custom file name node-custom.tpl.php it works.
In that case, what I would do is progressively replace each old line/section of code with a new line/section until the problem stops/appears. That will pin-point the problem area.... maybe if you paste your code, we can give more specific feedback
Thank you for your
Thank you for your response.
I've spent the past hour alternating various sections of code, replaced everything I possibly can and still no luck. I'm wondering if it has something to do with the way I'm printing the image field? The code I'm using is as follows:
Even this snippet of code integrated in with the original node.tpl.php code doesn't have any effect.
Write field, not a given rendering in array
The way you are writing the field suggests that you are writing the first items in the array in that field - which is most probably the uploaded unmanipulated image.
Try writing the field simply as
print $node->field_image;and that should defer to the "display fields" option you have selected for that field in the content-type configuration tab; thereby using the selected imagecache option.
Full tutorial to do this with lightbox2 integration too !
Hi there,
Maybe, it is 3 months later, but I've found this topic using google, but non of the solutions worked for me... coz I needed images to appear in lightbox ! so this tutorial posted in lightbox2 documentation helped alot http://drupal.org/node/274487 this is the link to the node !
also wanted to point out that using
print $node->field_image_field_nameprints out NOTHING (or in fact it prints "array" :D