Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment #1
x3cion CreditAttribution: x3cion commentedHi,
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.
Comment #2
podarokPlease, use proper status messages