Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
andreiashu CreditAttribution: andreiashu commentedHi,
It should work with this
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
Comment #2
nimzie CreditAttribution: nimzie commentedweird, 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?
Comment #3
andreiashu CreditAttribution: andreiashu commentedTo 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.