This is a great module. Very helpful.

I've got the profile pointing to a content type 'profile'.

I want to pull things like 'first name', 'last name'

of the content creator out and post in the node tpl.

I also want to pull by user id in different scenarios.
I've tried:

<?php
  global $user;
  $profile = content_profile_load( profile, $user->uid );
  print ( $profile );
?>

to no avail.
I've also tried print_r.

Any tips?

Comments

andreiashu’s picture

Hi,
It should work with this

$profile = content_profile_load('profile', $user->uid );

If it still doesn't work, double-check if you really have that node into DB.

PS: it is also advisable to use Devel module when debugging: use functions like dpm, dsm, etc when printing out something.

Good luck

nimzie’s picture

weird, I tried your code and it doesn't work.
I looked in the db, and there is a content_type_profile as well as a type profile in the content types listing.

Should this code be runnable from a node-x.tpl.php file?
does it require any globals or anything?

andreiashu’s picture

To print out some fields from a template you can look over this comment: http://drupal.org/node/316009#comment-1189756
Also there are some docs into the tar archive of CP that can help you out more.