Replacing default /user page with nodeprofile

Sansui - March 9, 2009 - 20:46
Project:Node Profile
Version:5.x-1.4
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

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?

#1

Sansui - March 9, 2009 - 21:06

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.

 
 

Drupal is a registered trademark of Dries Buytaert.