Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

Making use of local user image or Gravatar in Twig

theme

Started by Joaquim Homrighausen 3 years ago · 0 replies · 521 views
3 years ago

As a learning experience, I'm creating an inherited theme from Lingonberry.

Notice that the partial, header.html.twig, makes a reference to site.author.gravatar.

What I'd like to do is to use site.author.avatar (does that exist?) or possibly page.header.author.avatar (does that exist?)

I haven't been able to find this in the documentation, but maybe I'm looking in the wrong place.

Or does site.author.gravatar (for example) work even for local "avatars"?

I see that \Grav\Common\User\DataUser\User exposes getAvatarUrl(), but how do I do that from a Twig template?

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Sebadamus, 2 days ago
2 65 21 hours ago
Themes & Styling · by martynfoster735, 4 days ago
1 158 3 days ago
Themes & Styling · by Justin Young, 2 weeks ago
1 218 2 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 349 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 704 3 months ago