Step 5: Use usernode for presenting multiple node profiles or user searches (optional)

Last updated on
30 April 2025

Introduction

In Drupal 5, users are not associated with a node. This limits the configuration of the user settings and details that can be entered into the page. The Usernode Module, Bio Module and Node Profile Module both associate nodes with users.. On registration these modules automatically create nodes, and when a user is deleted the node is also removed. Drupal 6 replaces both Bio, Usernode and Node Profile with Content Profile. Drupal 7's core includes the functionality of these nodes. For the purpose of this document we will limit the scope to the Usernode Module on Drupal 5.

Usernode Module Possibilities

With the Usernode Module installed, the Nodeprofile module sets a Nodefamily relation between the content type of usernodes and all nodeprofile content types. This means that it is possible to easily get all node profiles to display the Usernode on the User Profile Page. Usernode default provides a link to each nodeprofile of a user on its usernode. You can theme the usernode to show the full profile(s).

The Usernode is useful in conjunction with Nodeprofiles. For example, if you need a page for each user, where you want to present the available data. Usernode comes with a template.php, which adapts user links to point to the usernodes instead of user/USER_ID. If your theme already has already a template.php file, just put the functions of usernode's template.php into yours.

Another usernode example is building user listings or user searches with views. Due to the automatically created Nodefamily relation between your usernode content type and your Nodeprofiles, it's even possible to include profile data into these user listings or searches. To do this, you need to use the views fusion module. Have a look at Step 4, which explains how the views fusion module can be used. The only difference is that one of your fused views has to list the usernode content type.

So e.g. if you have a view "profile" that lists your Nodeprofiles, create another view "Usernodes" which lists nodes of the "usernode" content type. Then create a fusion, e.g. use the Usernode view as primary view fused with the profile view using the Nodefamily parent-child relation.

These queries help to understand the relations.

Join users with their nodes


SELECT * FROM users AS u
LEFT JOIN usernode AS un ON u.uid = un.uid
LEFT JOIN node AS n ON n.nid = un.nid
LIMIT 5

Get the profile nodes. Should be limited by user and type

SELECT * FROM users AS u
LEFT JOIN usernode AS un ON u.uid = un.uid
LEFT JOIN nodefamily AS nf ON nf.parent_nid = un.nid
LEFT JOIN node AS n ON n.nid = nf.child_nid
LIMIT 5

Additional References

Advanced Profile Kit is an Advanced Module for developers who are familiar with CCK, Views, and Panels. It combines among other things, User Relationships, Guestbook, Private Messages and many other modules. The Advanced Profile project leaps forword the profile page into a full social network based profile.

Help improve this page

Page status: Not set

You can: