Right now, on my frontpage, node image thumbnails come below the teaser, this takes up a lot of space.

Instead I want the node image to be to the left of the teaser, INLINE.
Kind of like this website:
http://www.pixel2life.com/

I have looked into node.tpl.php, nodeimages.module, to try and edit it, but I cannot find the place where the $node->teaser connects with a "
" and then the node image thumbnail. The only thing I find is "$content" in node.tpl.php, but that $content is not defined anywhere, and apparently, it includes the teaser inside it as well as the node image thumbnail. I tried adding $node->node_images to the top of the $content, but that just makes node image thumbnails appear TWICE.

Thanks for your help.

Comments

executex’s picture

I found a sort of weird solution...
I added
-2 weight to ['content']->node-images, in nodeapi hook (under 'above'), that way, the "node image thumbnails" on the first page appear above the teaser.
Then I edited CSS of my theme, and added:
.node_images{
display: inline;
float: left;
padding-right: 5px;
}

Seems to sort of work with my theme. I guess this is a sort of solution, but I'm sure you know better.

Ceb’s picture

That hack didn't work for me. At least the CSS part, I'm not too sure exactly where he was suggesting to put the -2.

Is there another way that this can be achieved?

Ceb’s picture

Status: Active » Fixed

In your theme's node.tpl find:

<? print $content?>

And replace it with:

    <?php if ($teaser): ?>
     <?php if ($node->node_images) { ?>
		<div style="float:left; width:105px;">
        <br />
  	    <?php print $node->node_images ?>
		</div>
        <?php print $node->content['body']['#value']; ?>
	<?php }?>
    <?php else: ?>
    <?php print $content ?>  
    <?php endif; ?>

In the div style, you can see I set float to 105px, this is because my thumbnails are at 100px and it creates a bit of a spacial border.

Ceb’s picture

Status: Fixed » Closed (fixed)
so4’s picture

How do I make this work for only one content type teaser?

Ceb’s picture

Sorry for the very late response, but I figured I'd put it in anyways for anybody else who comes looking even if you've already resolved it. Now, I'm no expert in PHP but I'm guessing you would need to do something like this:

<?php if ($teaser) && $node->type == 'nodetype': ?>

Or use two if statements
<?php if ($teaser):
    if ($node->type == 'nodetype') {
    }

I wouldn't be surprised if neither of these worked exactly as written as I'm new to PHP, but they should definitely put you on the right path.

webel’s picture

When using just Inline and image attachments there is no 'node_images', and this gives no output for teasers.

Does anyone have a solution without Node Images ?

Node Images does not integrate with Private Upload.

Todd Young’s picture

On 6.15, to make the code in #3 work, I had to move the

<?php }?>

up a couple lines to just after the close div tag to make it work - otherwise teasers with no images would not show their text.

Flandry’s picture

Sorry, this is a powerful thread necromancy, but this is exactly the issue i want to resolve. I'm using D7 and my theme doesn't appear to have a node.tpl file. I actually have two issues. Besides wanting the node teaser thumbnail to appear inline with the text, i'd also like to be able to exclued any other images from appearing in the teaser. As it is now, if i float an image at the beginning of the content, it ends up in the teaser full-sized along with the thumbnail.

What's the most correct and general way of resolving this in D7?

Thanks.