Avatar not shown
lucosius opened this issue · comments
lucosius commented
Question
Hello,
After upgrading to CraftCMS 4 - the user avatar is not being displayed... In the source code I can see that URL is not set into img tag.
I have this code to get avatar url:
{% if comment.can('showAvatar') %}
{% set avatar = comment.getAvatar() %}
<div class="comment-item-userpic">
{% if avatar %}
<img src="{{ avatar.url({ width: 65, height: 65, mode: 'fit' }) }}" class="image-cover"/>
{% else %}
<img src="https://telefonai.eu/avatar.jpeg" class="image-cover"/>
{% endif %}
</div>
{% endif %}
System can see if avatar exist but cannot put URL. What can be wrong here?
Additional context
No response
Josh Crawford commented
Likely duplicate of #261 which again, this should've been created as a Bug Report issue, not a question.
What are your asset volume/filesystem settings? What does a {% dd avatar %}
produce just above the <img>
tag?
lucosius commented
I fixed this problem with changing avatar query to this:
{% set avatar = comment.author.getPhoto() %}
Josh Crawford commented
Closing in favour of #264