Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 765 Bytes

custom-avatars.md

File metadata and controls

24 lines (14 loc) · 765 Bytes

Custom Avatars

go back to Table of contents


To customize the avatars simply create directories:

  • app/Resources/AdmingeneratorGeneratorBundle/views/Navbar
  • app/Resources/AdmingeneratorGeneratorBundle/views/Sidebar

And create avatar_source.html.twig files in each directory.

Customize the template to render an URL to the correct image. Example implementation with FormExtensionsBundle configured to work with VichUploaderBundle and LiipImagineBundle:

{# avatar_source.html.twig #}
{{ image_asset(app.user, 'avatar')|image_filter('avatar') }}

Once you're done, you MUST clear your cache (even in DEV mode) with php bin/console cache:clear -e=prod (or dev).