Implemented Feature Request? [Ability to Suppress Author Profile Photo]

More
1 week 5 days ago #3264 by CCAZ Marketing
This message contains secure information

Please Log in to join the conversation.

More
1 week 5 days ago #3265 by Ruud van Lent
Hi,
this is possible using template overrides.
the 'smiley' is the default imahe that is provided by the custom field. So basically when the user doesn't upload an avatar, it actually gets one > the smiley. On my blog sites I noticed that this is a good incentive for the authors to actually upload one of their own :)

Using template override you can basically change everything in ochBlog and those changes will survive upgrades.

Here is a short how to:
in ochBlog > options > advanced setting check what layout you are using (default, bootstrap5, uikit)

then goto System > Site templates and select you (active) template
select tab 'create Overrides'
in column 'Layouts' select com_ochblog and select the layout (the one you are using: default, bootstrap5 or uikit)

The layout files used on your site will now be copied for you to edit

Go to tab 'Editor' and select in the template directory > html > layouts > com_ochblog > default > article_info.php

This is the layout file for the article info (on top of the article).

on line 23, you can add the following code:
Code:
if (stripos($displayData->authorAvatarImage, 'default-image.png') !== false) {$displayData->avatarProvider = 'none'; }

save the file and check if the image is gone for users that have the default avatar set. (note that you need to clear cache for the changes to take affect)

So what did we just do?
we check if the authorAvatarImage has default-image.png as file name, and if so we just set that we do not have a avatarprovider configured > so the avatar will not be displayed.

you need to add the same code in file author_info.php (which is responsible for the information in the bottom of the article).

If something goes wrong: no panic, you can just delete these file in the template override and then the ones provided by com_ochblog will be used and you can start over.

let me know if this solves it for you or if you need more info / help.

regards,
Ruud.
 

Please Log in to join the conversation.