chatter icon indicating copy to clipboard operation
chatter copied to clipboard

User avatar if one exists, if not use Initials

Open packytagliaferro opened this issue 7 years ago • 1 comments

I know that I have 2 options for user image in the config file:

'avatar_image_database_field' => 'avatar',

Will show the avatar in my DB

'avatar_image_database_field' => '',

Will show the username initials and a color background.

Is there a way to defualt to the Initials if the avatar field is null? That is how my app is set up so the forum would be nice to see like that as well. Just from a UI standpoint, it would be a nice option for anyones app since as of now there is just no image if the user doesnt set one.

packytagliaferro avatar Sep 21 '17 17:09 packytagliaferro

I may be late but as this issue was open and just started using this package and also wanted such functionality. what you need to do is override below php files into your ownresources/views

  • home.blade.php

  • discussion.blade.php it would be something like this ROOT/resources/views/vendor/chatter and add your logic there you can see how to override these php files on the main documentation page under OVERRIDING VIEWS heading, you can search for chatter_avatar class in these two php files this class is assigned to the div that contains user avatar

alizaidi606 avatar May 03 '18 14:05 alizaidi606