Some help with nodeprofile_load function?

Events happening in the community are now at Drupal community events on www.drupal.org.
elly's picture

Hi all,

My site is 5.10 and using node profile module. I'm creating a complex CCK custom form template, and I'm trying to include user information about the current user in the top of the form, such as "you're currently logged in as Firstname Lastname" in the top of the template before the form is rendered, as well as print certain fields based on information in the user's profile.

My node profile node type is called "vspot-profile". I am using the following just to test and see what info is available to me, and not having much luck.

<?php
global $user;
$vspotprofile = nodeprofile_load('vspot-profile', $user->uid);
?>

<?php
var_dump
($vspotprofile);
?>

When I put this in my template, all that prints to the page is

bool(false)

At first I thought this was because I hadn't created a profile, but it's appearing this way even after I made sure the logged in user had a node profile associated with their user page, and after I cleared the cache just to be sure.

Can anyone help me figure out how to load the node profile of the current user into this template?

(Incidentally, I'm using this method of making a very customized CCK form template: http://drupal.org/node/101092)

Thanks,
-elly

Comments

doh

elly's picture

nevermind, i got it working!

.

michelle's picture

Since you hunted me down on IRC, you owe me a curiosity cure. :P What was the problem?

Michelle


See my Drupal articles and tutorials or come check out the Coulee Region

Profiles as nodes

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: