Comment to 'Default Profile Photo per gender'
  • LeonidS still not very clear to me. Can you help me with a sample code for _getUnitThumbUrl method and the 'condition' => !$bThumbUrl section?

    I can see a few people liking this discussion question and seem interested in your sample code modification.

    • You may set the condition as false (forever) via this way:

       'condition' => false, 

      the _getUnitThumbUrl method provides the URL of the image URL from the methods like urlThumb etc (see the same class). Each of them contains the case when the image isn't found like no-picture-thumb.png (in the same class). So you need to redeclare this method in the Template class of the necessary module and process if the result of image URL contains the no-picture word then process it with another, according to aData info.

      • LeonidS it's still challenging

        My current thought is to create SAMPLE PROFILE (for example profile with id=10) on my website and make its profile photo the default photo. So, if the new user does not upload a profile photo, the template will show the profile photo of the SAMPLE PROFILE

        to do this, I only need to set the default value of the $aData variable for _getUnitThumbUrl method to pass the profile id=10

        may be something similar to:

        $sDefaultThumbUrl = $this->_getUnitThumbUrl ($sTemplateSize, $aData=<PROFILE_ID>, false);

        my questions now, how to set the $aData varialbe to include the profile ID of my SAMPLE PROFILE.