By Anonymous (not verified) on
I'd like to be able to control which fields in a user's profile are displayed, depending on the role of the logged in user.
I've set up a custom user_profile.tpl.php file, and it seems to me that I should be able to control what's displayed using a simple if statement based on the logged in user's role.
The problem is I can't work out how to get the role of the logged in user without using the global $user variable (because of course as soon as I add that to the page the profile gets replaced with the logged in user's profile).
Is there another way to do this?
Thanks
Barry
Comments
I used the global
I used the global variable:
And then, checked the $user:
Thanks very much for the
Thanks very much for the response Tistur.
I think I understand it :) Will give it a try.
I used something like
I used something like this...