webseite-grav/plugins/form/templates/forms/fields/avatar/avatar.html.twig

11 lines
480 B
Twig
Raw Permalink Normal View History

2021-04-30 11:23:26 +02:00
{% extends "forms/field.html.twig" %}
{% block field %}
{% set avatar = form.value('avatar') %}
{% if avatar %}
<label class="{{ field.classes }}"><img class="{{ field.img_classes }}" style="max-width:200px;" src="{{ base_url_simple ~ '/' ~ (avatar|first).path }}" /></label>
{% else %}
<label class="{{ field.classes }}"><img class="{{ field.img_classes }}" src="https://www.gravatar.com/avatar/{{ form.value('email')|md5 }}?s=200" /></label>
{% endif %}
{% endblock %}