When printing an imagecache _linked formatter via template (in a 'mycontent-node.tpl.php' file) like this:
print content_format('field__image', $field_image[0], 'thumb_linked');

The result is an image linked to the frontpage not to the relative node. If I set the _linked formatter on the CCK settings page and output the node printing $content everything is fine.

Comments

drewish’s picture

Status: Active » Closed (works as designed)

yeah it uses the fields formatter... what else where you expecting?

sp3boy’s picture

Having spent substantial time on exactly the same problem with a D5 system, where I wanted the teaser preset defined for my field 'field_primary_image' to be correctly output as "...thumb as link to node", it may be worth commenting that by adding the full node parameter to the content_format() function call I got the link to the node to be output, thusly:

// Get current teaser display setting format.
$content = content_types($node->type);
$preset_formatter = $content['fields']['field_primary_image']['display_settings']['teaser']['format'];

// Format the field content accordingly.
content_format('field_primary_image', $node->field_primary_image[0], $preset_formatter, $node);

I hope this will continue to work for D6, haven't got the chance to test it yet.

drewish’s picture

Since you didn't change the version on the issue I'm guessing your still working with a really old version. You'll find that the -dev version has a very different system.