ArashDev Posted August 21, 2023 Posted August 21, 2023 (edited) hi my lord I use the following code to display the name of the topic solver in topicrow template. However, I want to display the user's avatar who solved the topic instead of the name. {{if $solvedComment = $row->getSolution() AND ( $solvedComment->hidden() == 0 OR ( \in_array( $solvedComment->hidden(), array( 1, -1 ) ) AND $solvedComment->canUnhide() ) )}} {lang="solved_byline" htmlsprintf="$solvedComment->author()->name"} {{endif}} thanks! Edited August 21, 2023 by Arash.Ranjbar
Management terabyte Posted August 21, 2023 Management Posted August 21, 2023 You can access the member data using $solvedComment->author(). For an example of the HTML to display the avatar simply look at other templates that show the image. Here's a quick example: IMAGE ONLY: <img src='{$solvedComment->author()->photo}' class="ipsUserPhoto ipsUserPhoto_mini"> === IMAGE WITH PROFILE LINK: <a href="{$solvedComment->author()->url()}" class='ipsUserPhoto ipsUserPhoto_mini'><img src='{$solvedComment->author()->photo}' class='ipsUserPhoto ipsUserPhoto_mini'></a> You can also replace ipsUserPhoto_mini with other CSS classes: ipsUserPhoto_tiny ipsUserPhoto_medium ipsUserPhoto_large (this is the class used in posts) ArashDev 1 Board Rules - Available Products - Need a Custom Work? < Don't PM me for support, post in the forum or submit a ticket from the client area instead! >
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now