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.
Hi all!
Need some help, becouse i'm realy stuck on getting comments from content_profile on my users profile pages.
What i do:
In user-profile.tpl.php:
$node = NULL;
$node_profile = $content_profile->get_variables('profile');
if($node_profile)
$node = &$node_profile['node'];
// [ ... ]
// This is the ready-for-print variable for the user profile data
print $user_profile;
// [ ... ]
// Print this wherever you want to show the node_profile content
print node_view($node, FALSE/*teaser*/, TRUE, TRUE);
// [ ... ]
// Put this where you want to show your comment block
if ($node && function_exists('comment_render')){
if( $node->comment)
{
print comment_render($node);
}
}
and that code causes an error:
Fatal error: Call to undefined method stdClass::get_variables() in user-profile.tpl.php on line 132
What i'm doing wrong?