By ravisagar on
Hey guys!!
I am working on a matrimonial website build using CCK/Views/Content Profile Module for basic functionality and other modules for various features.
Now my client wants that when a user is creating his/her profile he/she should be able to tick a checkbox for displaying the picture. Images should be hidden by default.
Is there any module for doing this, I found one module "Conditional Fields" would that work for achieving this?
Thanks in advance!
-Ravi
Comments
hook_user
You could write a custom module and leverage hook_user and the Forms API to customize the display.
Example (not tested, just for the structure):
I have pretty good knowledge
I have pretty good knowledge of Drupal configuration but not php scripting. I guess this code will hide the picture for all roles. What if the User itself is viewing his/her content profile and Admin is viewing any user's profile? Would they be able to see the pictures. The image has to be hidden from non-admin uers only.
One more thing, I am using content profile and the images are basically imagefields. So in the above code I would replace the line
unset($account->content['picture']);
with
unset($account->content['field_picture']);
where "field_picture" is CCK's imagefield. I hope I am correct?