Hide empty profile fields

Hi,

I added some new optionally profile fields that users can complete Editing their profiles. The problem is that the fields appear even if they are not filled, with the mention: "=wrong=".

I would like they don't appear if there are empty. If it's not possible, how to replace the mention =wrong= with everything else ?

Thanks for your help !

Quote · 31 May 2008

Open the file "templates/base/scripts/BxBaseProfileView.php"

Find the line "if( !$sValue1 )" it will be in line 266.

Replace it with

if(!$sValue1 || $sValue1 !== '=wrong=')

----
Quote · 31 May 2008

Is this for unpopulated fields within a block, because not displaying on the profile was working for me by default and did not require a code change.  What I would like is for the entire block not to display on the profile if none of the fields within it are populated.

Quote · 31 May 2008

Yes, it will work default.

but here nancycity has created this own list. This solution suites only for him.

----
Quote · 31 May 2008

Got it, thanks.  Any thoughts on how to make it so block doesn't appear on profile if none of fields within is populated?

Quote · 31 May 2008

Try adding this before

"echo DesignBoxContent( _t($sCaption), $sRet, 1 );" in that function

add:

if(!$aItems)

return '';

----
Quote · 1 Jun 2008

Hi Praveen - I assume your post above is in response to my hope to have the block not display is there are no items populated.  I tried what you suggested and it doesn't seem to have any affect.  Any further thoughts?  The code now is:

 

  if(!$aItems)
      return '';
   echo DesignBoxContent( _t($sCaption), $sRet, 1 );

Quote · 1 Jun 2008

Hey there, I am trying something similar, have you found a work around?

Quote · 18 Aug 2008
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.