Timeline for How to print a custom user field in comment.tpl.php?
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 10, 2014 at 0:52 | comment | added | Darvanen | Likewise, figured it was something along those lines. | |
Sep 9, 2014 at 23:34 | comment | added | Beto Aveiga | Cool! Glad to hear it! | |
Sep 9, 2014 at 18:06 | comment | added | Ian | @BetoAveiga I've implemented what you said and got it working! | |
Sep 9, 2014 at 17:38 | comment | added | Ian | @Darvanen figured it out! check out my answer :D. | |
Sep 7, 2014 at 17:53 | comment | added | Ian | @BetoAveiga Yes, the template is the correct one. It's outputting other changes I put to it. I'll try your suggestion about loading comment UID (which makes sense) after I test ride solr search. | |
Sep 7, 2014 at 9:09 | comment | added | Beto Aveiga | Have you tried to write something else just to see if your modifying the right template? I think that if you render field_avatar the result will never be user->picture. Also if you want to get the author of the comment just load it from the comment uid property. If you haven't loaded the comment yet then just do it, probably it will be in Drupal's cache anyway so it will not hurt performance. | |
Sep 7, 2014 at 2:21 | comment | added | Ian | I'll just resort to views for now. >.> | |
Sep 7, 2014 at 1:17 | comment | added | Darvanen |
perhaps render() doesn't work the same way for $author fields, or the $author object is structured differently to $user. You can use dpm($author); to check the object (make sure devel module is installed first).
|
|
Sep 7, 2014 at 0:57 | comment | added | Ian | Unfortunately, I've tried $author and $node to no avail :(. I'm reading comment.module to get some insight. | |
Sep 7, 2014 at 0:45 | history | edited | Darvanen | CC BY-SA 3.0 |
added 66 characters in body
|
Sep 7, 2014 at 0:44 | comment | added | Darvanen | Oh of course, hang on I'll update the answer. | |
Sep 7, 2014 at 0:35 | comment | added | Ian | I tried it. Cleared the cache and everything. Unfortunately, It's still rendering the default picture. Note: I'm not trying to print the current user of the site, but the author of the comment. | |
Sep 6, 2014 at 23:57 | history | answered | Darvanen | CC BY-SA 3.0 |