I have been trying to get the memberlist module to display the member's avatar in the frontend. I have looked at the templates for helpdesk (which displays the avatars fine in the front end on my site) but it keeps pointing to the wrong file in the memberlist. There seems to be no way of indicating Avatar in the public fields list of the memberlist module settings in the backend. Seems an easy fix to this problem. I would find it hard to believe that I am the only person on the planet using Contao that does not want avatars included on the profile display of a member as accessed through the memberlist module, perhaps I am??
I made changes to the mod_memberlist template (or rather, made a copy and tweaked it) to try to include pulling the avatar, but it keeps pointing to the wrong file and only displays the "default" image (the gray head). I want the avatar image in place of the "details" image (the little blue circle) so I put <?php echo Avatar::img($col['id']->avatar); ?> in the last column. The full row (including other fields) looks like this in the template (addition is in bold below):
<tr class="<?php echo $class; ?>">
<?php foreach ($row as $col): ?>
<?php if ($col['field'] == 'username'): ?>
<td class="body <?php echo $col['class']; ?>"><?php echo $col['content']; ?></td>
<?php else: ?>
<td class="body <?php echo $col['class']; ?>"><?php echo $col['content']; ?></td>
<?php endif; ?>
<?php endforeach; ?>
<td class="body <?php echo $this->col_last; ?> col_last"><?php echo Avatar::img($col['id']->avatar); ?></td>
</tr>
Anyone know what I'm doing wrong? Anyone know how to display the avatars correctly using the memberlist module? Am I missing a really simple tick box somewhere in the backend settings?????
Bookmarks