Hi

I've searched and can't find the answer to this; apologies if it's there somewhere...

I'm trying to customise a node-custom.tpl.php, and need to show an image from a referenced node.

If I print the $node array, it seems to give me $node->field_custom[0]['#view'], but this doesn't work in my template file.

Also, in the $node array this is displaying the entire node, how can I restrict it to display only an image?

Thanks

Glenn

Comments

glennnz’s picture

Solved

Just created a View to show the image (using a relationship and an argument), and used

<?php
$block = module_invoke('views', 'block', 'view', 'view_name-block_1');
print $block['content'];
?>

Sweet!

markus_petrux’s picture

Status: Active » Fixed

If you have a $node, then you can probably use content_view_field() or content_format(). See how to use them in content.module inline documentation.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.