Skip to content
● Critical PHP security fixes are out: update PHP on your Grav sites. What to do →

Making use of local user image or Gravatar in Twig

theme

Started by Joaquim Homrighausen 3 years ago · 0 replies · 706 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 FrViPofm, 1 month ago
4 554 4 weeks ago
Themes & Styling · by johan thomas, 5 years ago
1 869 1 month ago
Themes & Styling · by stuart young, 3 months ago
3 730 2 months ago
Themes & Styling · by Sebadamus, 3 months ago
5 751 3 months ago
Themes & Styling · by martynfoster735, 3 months ago
1 700 3 months ago