Posted by morisy on January 18, 2010 at 8:01pm
I'm trying to float the CCK body text around an image, but I just can't get it to work no matter what I try. Here is the current relevant code node.tpl.php:
<?php if ($node->field_vendorpic[0]): ?>
<?php print theme(
'imagefield_image',
$node->field_vendorpic[0],
$node->field_vendorpic[0]["alt"],
$node->field_vendorpic[0]["title"]);
?>
<?php endif; ?>
<?php print $node->content['body']['#value']; ?>
</div>I can't figure out how I can include that image in a float, and when I try enlosing it in some HTML to float it, it either a) still appears above the text or b) disappears completely.
The page is located at:
http://sparechangenews.net/vendor/peaches
Any ideas? Thanks!

Comments
You're not asking a CCK
You're not asking a CCK question; you're asking a CSS/styling question. You should use CSS to add a "float: left;" attribute and value to the image. You probably want to add a margin as well.
The Boise Drupal Guy!
Thanks Garrett
I guess the part of the question I thought of as "CCK" was how to pull, for example, just the link to the image, so I could then embed it like:
<img source="<?php print magicalfunction()"; ?> float="left">After reading your post, I realized it probably just makes sense to drop it in a DIV, and now it works fine.
Web guy, SpareChangeNews.net
Twitter: @morisy / @sparechangenews
share
Hey morisy, I don't suppose you'd be interested in sharing the code that you used to make it work? I'm none too good at CSS or php, so I'd to cut some corners if you don't mind helping out.
Thanks!