By tanepiper on
Hey there,
I have finally managed to get my own node template file working (node-artist.tpl.php) for a CCK content type called "Artists".
Now in the CCK node type, there is the title, body an attached image using the image_attach.module, this has been previously uploaded as a seperate image, and 4 extra link fields that I have added to the content type.
The $content field is of course made up of all of these items, which looks ugly so I am trying to theme this. I have tried the below to extract just the body text, but cannot seem to get it to work
foreach ($content as $artistcontent) {
print $artistcontent->body
}
All I get is Invalid argument supplied for foreach() in node-artist.tpl.php on line 11 (which is the foreach line).
Any ideas?
Comments
You may or may not be
** Agh... never mind. I didn't see that this post was categorized under Drupal 5.x. My mistake. **
You may or may not be interested in going this route, but if you're running 4.7...
I've been using the Contemplate module to handle this. It's great because you can style the full view and teaser view separately. I ran into a few bumps getting it to not display empty fields, but I found the solution in this forum and it wasn't difficult. I can re-post it here if I'm not able to find the original thread and link to it.