Closed (works as designed)
Project:
Nodecarousel
Version:
5.x-1.0
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2008 at 18:03 UTC
Updated:
18 Mar 2009 at 23:32 UTC
This is probably a minor php matter: I'm trying to get Node Carousel to display images from a CCK image field. Although I've been able to modify the theme in other ways, I can't get images to work. (these are additions in the "function theme_nodecarousel_node($node, $name='')" section of the nodecarousel.module.
For example, this custom CCK text field will display:
$content .= '
';
However, this custom CCK image field will not:
$content .= '
';
Any direction on this is greatly appreciated.
This is an amazing module - I can't wait to use it fully.
Comments
Comment #1
jcfiala commentedHmm... Here's the problem - all I do on the nodes is load them - I don't tell them to build themselves ready for viewing. As such, the field_f_carousel_img[0]['view'] has no data in it.
I set up a similar situation with my own test code, and I find that what you probably want to do is to call node_build_content() on the node - I suggest taking a look at it's documentation or for node_view, which uses it.
Personally, with CCK Image fields, I always use imagecache for my images, so I was using theme('imagecache', 'thumbnail', $node->field_image[0]['filepath']); for my own testing. However, when I did the following, it worked fine:
Note that I had to extend l out far enough to tell it that I was handing it HTML - otherwise it'll escape it all out for you.
Comment #2
verbidei commentedThanks for your help on this. The imagecache concept makes a bit more sense now that you point it out.
Comment #3
edzhus commentedthis one works for me:
in template.php
Comment #4
gav240z commentedI'm having trouble with this, seems to output everything but the filepath to the image correctly.
I'm using Drupal 6 though so maybe there's a change in the code or template.php I need to make.
I then changed
$content .= '
';
to
$content .= '
';
Because my CCK field was called photo and not image. However I still get strange image paths.
As you can see the file path for the img tag is not complete.
http://localhost/drupal-6.10/sites/default/files/imagecache/imagecache_preset