V8: Larger user avatars?

Permalink 1 user found helpful
Hi,

In C5 v8 can I output a larger Avatar than I get using the simple print $avatar->output(); method?

I can't seem to use getThumbnail or get the file ID to output a larger image.

Thanks
Dave

madesimplemedia
 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi madesimplemedia,

It looks like the output() method returns a string with the img tag and attributes. The image it returns looks to be a specific version, not the original.
https://github.com/concrete5/concrete5/blob/8.0/concrete/src/User/Av...
https://github.com/concrete5/concrete5/blob/8.0/concrete/src/User/Av...

I am not sure how, or if, you can get the underlying file object that is used to create the avatar image.

An alternative to getting the original file object would be setting custom width and height for avatars.
https://github.com/concrete5/concrete5/blob/develop/concrete/config/...

Example: change avatar max width/height from 80px to 300px
application\config\concrete.php
<?php
return array(
    'icons' => [
        'user_avatar' => [
            'width' => 300,
            'height' => 300
        ]
    ]
);
madesimplemedia replied on at Permalink Reply
madesimplemedia
Hi mate,

Thanks for this but adding those lines to concrete.php doesn't seem to do anything the avatar still appears 80x80, is my /application/config/concrete.php correct?

<?php
return array(
   'external' => array(
      'news_overlay' => false,
      // if you want to hide news from intelligent search:
      'news' => false,
      'intelligent_search_help' => false
   ),
   'icons' => array(
        'user_avatar' => array(
            'width' => 300,
            'height' => 300
        )
   ),
etc etc
MrKDilkington replied on at Permalink Reply
MrKDilkington
@madesimplemedia

Changing the config setting does not change the size of existing avatar images. You have to recreate them.