I really tried to find solution for this but I can't figure this out. How to add custom field to "advanced-forum.*.post.tpl.php", for example "field_image" and possibly with a custom image style.

Thanks in advance.

Comments

x3cion’s picture

Status: Active » Needs review

Hi,

all fields are available through the $content variable, like $content["field_image"]. Mind that this field should be assigned to both the forum node type itself and the comment, since both use the post template. Also, you should use hide() on your field like hide($content["field_image"]). Then you can use render($content["field_image"]) wherever you like.

Note though that I just don't use any easier way to do this, else I'd suggest it.

podarok’s picture

Status: Needs review » Fixed

Please, use proper status messages

Status: Fixed » Closed (fixed)

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