Hi. I'm using D7 and Zen, and a custom node.tpl.php file for the first time, so I can theme my nodes of type "post." So I made a file named "node--post.tpl.php," which is working fine, and I'm using

print render($content['post_author']);

where 'post_author' is a referenced node of content type "author," which has several fields, so the output of the above is the whole "author" node.

My question is this: How do I just pull one field from that referenced node (author) to show on the (post) node page?

I tried this:

print render($content['field_post_author']=>['field_author_bio']); 

to try to get just the "author_bio" field to render. The above has a PHP syntax error, so obviously it doesn't work. But maybe you can see what I'm trying to do? I'm trying to print one field of a referenced node, rather than all of them, which is what you get with

print render($content);

Also, if I use this:

print render($content['field_author_bio']); 

I get no output. Any suggestions?

Thanks!
Tim

PS: I think I posted this in the wrong place a few minutes ago: http://api.drupal.org/comment/edit/21084
Sorry about that... anyone with the right privileges should feel free to delete that post.

Comments

johnalbin’s picture

Component: PHP code » layout.css
Status: Active » Closed (fixed)

closing old support issues