Hello!!
What I need to do is to print my cck fields via php. I didn't find the array to do that in the documentation, and I'm not quite a programmer, you know.
I while explain my project shortly:
It is a image gallery using imagecache, views and imagefield. I created a content type containing an imagefield that shows my thumbnails in the gallery and a bigger image in the node.
But I want my nodes not to show any field except the image. Just the image and the title appear.
For this, my content type doesn't have the body field, and I added just a description text field that is hidden.
But I want this text field to be shown in another area of my page.tpl.php.
I know, for example, how to print the body field:
<?php print node->body; ?>
What I need is the variable to print just the text of my text field. If possible in a similar way I can print a body field. Does anyone know how I can do that??
I've tried a code I found (description is the machine-readable name of my text field):
<?php print node->field_description; ?>
but this just returns the word 'array'. I think this means there are more values indexed in this variable, but I tried many indexes [number] and I haven't found anything.
I'm already trying longer than a week here!!!
Please..............
Comments
Comment #1
andy tawse commentedPut
var_export($node)in your template, then "View Source" and examine the output. Then you'll be able to see exactly where the CCK data is.Comment #2
karens commentedSee the CCK handbook (http://drupal.org/node/62462) for more information about how to display D5 CCK data.
Comment #3
haraldessert commentedThanks, folks!!
Helped a lot!! =)
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.