Take the 2-minute tour ×
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It's 100% free, no registration required.

This might be a stupid question... but I can't seem to figure it out.

I'd like to show the photo of an author beside their entry. I thought the proper variable was...

{{user.photoUrl}}

...until I logged out and my photo disappeared.

share|improve this question

1 Answer 1

up vote 8 down vote accepted

That will get you the url of the current user's photo. To get an author's photo do this:

{{ author.photoUrl }}

If the author is not defined in your context but the entry is, then get the entry's author's photo as follows:

{{ entry.author.photoUrl }}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.