Download & Extend

How to display a CCK imagefield using contemplate

Project:Content Templates (Contemplate)
Version:6.x-0.14
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I have been looking around drupal.org and google to find out how i would add a cck imagefield to contemplate 6.

In version 5 it was easy just go to the body variables, select what you want and then its added. I have read you can do that with 6 yet when i try it i get everything but that. All i see is $node->field_page_banner (array) but i can not select it. I have tried to go to custom template settings and up the max recursion depth but that does not help. I have gotten the filefield to work and date but i can not get imagefield to display. All i can get displayed it a link to the image but i want to see the image not a link.

all i want to do is be able to display the image in a custom css wrapper. can anyone help?

Comments

#1

Help anyone!

#2

Title:Need HELP! CCK ImageField» How to display a CCK imagefield using contemplate
Priority:critical» normal

support requests aren't critical.

Are you also using imagecache ? if so I think you have to find the variable for that and not imagefield ? I don't have an install at moment with the imagefield.module & contemplate but hopefully the above will help guide you.

I don't believe the problem, if there is one, would be with contemplate but with imagefield and you may get more of a response in that issue queue.

#3

if you could paste in your body variables some <code> tags, it mght help us help you

#4

i'm using imagefield with this module, so below in this sample teaser code for a content type, simply replace your fieldname (mine is field_pics, not sure what your preset it)

BUT i can't get inline to respect padding - syntax?

<div class="field field-type-image field-field-image">
  <div class="field-items" style="float:left" margin="5px 0 10px 0">
  <?php if ($node->field_mainstorypic[0]['view'] > '') : ?><?php print $node->field_mainstorypic[0]['view'] ?><?php endif; ?></div>
<?php print $node->content['body']['#value']; ?>
  </div>

#5

@zilla

Probably a long past when you figured this out - but your styles should be this:
<div class="field-items" style="float:left; margin:5px 0 10px 0">

#6

Thank YOU! I never asked a question here (but I did here in a discussion on how to theme Content Templates / if there are any examples here which seemed the proper place http://drupal.org/node/536760 ) and this is probably closer to what I need to know.

What I am trying to achieve is that on the teaser, when the image is small, I want the text to wrap around it. Like, image to the left, wrapped text.

I also want to only allow *one* image n the teaser, regardless of how many images are attached to the node.

Once inside the node however, the image is as large as the theme allows. Then I find I have another issues, I often have several images, and would like to chop up the blocks of text to have images breaking it up once in a while. Not one giant block of text first and then all the images like ducks in a row after the text. In other words, I want to layout it nicer. How can I do this?

#7

I've asked a support question to skip threadjacking, it is here: http://drupal.org/node/566030