image on the right of a node's teaser ....

damianrr - June 2, 2007 - 04:21

I need to archive something similar to this: http://www.quartzmtn.com/portfolio/web_design ... my question is: how could i put an image in that position in the node's teaser??? and how can i put the image like this: http://www.quartzmtn.com/portfolio/web_design/greenman on the node's body???

thanks ......

Possibly helpful..

VPlex - June 2, 2007 - 07:39

For your second question: You just add a picture and choose left align (left float).

For the first question: I would make sure that the first picture I attached to each node is the one you want in the teaser. Then from there you just need to write a few lines of code for the teaser and wrap it in a table and some css.

If you need further help, just ask.

CCK

mango - June 2, 2007 - 09:26

Assuming you want to standardise the way pages look, I would create a CCK content type with two image fields. The images in the example you have provided are two different images, so you cannot create a smaller version of the full image to create a thumbnail. If they were the same image, but one just a thumbnail of the other image, you could use imagecache. As an example, imagecache has been used for this overview of the board of an NGO. You can also look at an example of a node where the image is aligned to the right as described below.

To place the images in the right place, you could use Contemplate and alter the template for your content type. I have pasted a bit of template code I have used to align a picture to the right in a content type, so you can get an idea of what it looks like. Contemplate already produces a standard template for the fields that you have defined. You can then edit that template to incorporate the alignment of images, changing text and headers and so on. I don't know if it is proper HTML and CSS, but it works for my sites.

<div class="field field-type-image field-field-manual-photo">
  <div class="field-items" style="float:right;margin-left:20px">
    <?php foreach ((array)$field_manual_photo as $item) { ?>
      <div class="field-item" style="margin-bottom:10px"><?php print $item['view'] ?></div>
     <?php } ?>
  </div>
</div>

To create an outline as listed at http://www.quartzmtn.com/portfolio/web_design, you would create a view listing all nodes of the content type. Theme the view using Views Theme Wizard and use a similar concept to place the images.

That site looks familiar...

khenney - June 2, 2007 - 21:01

I'll second mango's suggestion. The site is question (quartzmtn.com) is mine. For the portfolio I used a CCK content type with 2 image fields, with the images placed and aligned with a customized template.

 
 

Drupal is a registered trademark of Dries Buytaert.