Implemented Feature Request? [Ability to Suppress Author Profile Photo]
- CCAZ Marketing
-
Onderwerp Auteur
- Offline
Minder
Lees meer
- Berichten: 9
- Ontvangen bedankjes 0
3 maanden 3 dagen geleden #3264
door CCAZ Marketing
Feature Request? [Ability to Suppress Author Profile Photo] werd gestart door CCAZ Marketing
Dit bericht bevat beveiligde informatie
Graag Inloggen deelnemen aan het gesprek.
- Ruud van Lent
-
- Offline
Minder
Lees meer
- Berichten: 1707
- Ontvangen bedankjes 111
3 maanden 3 dagen geleden #3265
door Ruud van Lent
Beantwoord door Ruud van Lent in topic Feature Request? [Ability to Suppress Author Profile Photo]
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:
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.
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.
Graag Inloggen deelnemen aan het gesprek.