I'm trying to pull out user data in a template for specified user profiles whilst the current user is logged in. To do this I check on the userId being referenced and use:
{% if userId != currentUser.id %}
{% set userProfile = craft.users.id(userId).getContent() %}
{% endif %}
This returns a user object for that user. However when I try to reference any of the fields custom or otherwise for the userProfile it returns blank apart from on userProfile.id which returns the id of the required user.
So what am I missing? I was under the impression that getContent() would pull out all custom fields and these could simply be accessed by using the dot syntax? Or does this only work on currentUser?
Cheers