Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Making use of local user image or Gravatar in Twig

theme

Started by Joaquim Homrighausen 4 years ago · 0 replies · 825 views
4 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 David Garner, 5 years ago
15 1136 3 days ago
Themes & Styling · by MarkP, 3 weeks ago
3 219 2 weeks ago
Themes & Styling · by TomW, 3 weeks ago
0 136 3 weeks ago
Themes & Styling · by themetman, 4 weeks ago
1 230 3 weeks ago
Themes & Styling · by AH, 1 month ago
1 355 3 weeks ago