Download & Extend

Replacing default /user page with nodeprofile

Project:Node Profile
Version:5.x-1.4
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I'm looking for a way for a user's nodeprofile to take over the default profile display, instead of simply adding to it.

I'm using a snippet to take over the user profile in template.php and create a new tpl called user_profile.tpl.php.

<?php

function phptemplate_user_profile($user, $fields = array())
{
return
_phptemplate_callback('user_profile', array('user' => $user, 'fields' => $fields));
  }
?>

I tried the suggested code from the readme as follows, inside my user_profile.tpl.php, without success, as only the container div and the view/edit links show up, but not the content.

<?php
      $uid
= arg(1);
     
$output = array();
     
$output[$type] = array(
       
'#type' => 'nodeprofile_display_full',
       
'#title' => node_get_types('name', $type),
       
'#tabs' => array('view', 'edit'),
       
'#uid' => $uid,
       
'#content_type' => 'uprofile',
       
'#weight' => 0,
       
'#suffix' => '<br />',
      );
      echo
drupal_render($output);
?>

Any suggestions?

Comments

#1

Ahh, now I see. Under my node profile settings under the content type, had to remove it from user categories and remove it from display on user page. After doing that, the profile appears using the code in question.