Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 618457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:32:52+00:00 2026-05-13T18:32:52+00:00

Using the profile module I’ve created a textfield called profile_real_name which the user fills

  • 0

Using the profile module I’ve created a textfield called profile_real_name which the user fills out when registering. How do I access this variable in the node.tpl.php?

I used the dsm($user) function to output the user variables and it contained everything except the data for the profile_real_name

I also ran dsm($vars) on the phptemplate_preprocess_user_profile and I could see it contained an object called account which did contain the info I needed but this object isn’t available in the $user variable.

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:32:52+00:00Added an answer on May 13, 2026 at 6:32 pm

    If you want to access the author’s profile information in node.tpl.php, then you want to work with a phptemplate_preprocess_node function rather than the user_profile one. The node preprocess function doesn’t have an $account object by default though, so you’ll have to load it in:

    This goes in the phptemplate_preprocess_node function in your template.php file:

    if ($vars['uid']) {
      $vars['account'] = user_load(array('uid' => $vars['uid']));
    }
    

    Then you would be able to access the author’s profile values in your node.tpl.php. The value you asked about specifically would be:

    print($account->profile_real_name);
    

    However, it sounds like you might want the node author’s name to appear as the profile_real_name value rather than their account name?

    If so, a MUCH more efficient way would be to override the theme_username function.

    That’s not directly what you asked about so I won’t go into it here, but this post on the drupal.org forums would be an excellent place to start for Drupal 5 or 6:
    http://drupal.org/node/122303#comment-204277

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm storing some additional per-user information using the AUTH_PROFILE_MODULE . We can access the
I am looking for a way to search through every users profile using the
When I profile my application using SQL Server Profiler, I am seeing lots of
When using the unmanaged API for the .NET framework to profile a .NET process
I can't use the Get*Profile functions because I'm using an older version of the
I'm trying to find SQL statements that timed out using the SQL 2005 profiler.
I have a report that renders data returned from a stored procedure. Using profiler
I'm using the django-contrib package django-profiles , and everything is working great - my
Do you have any tips for effective profiling using Netbeans? The profiler is quite
I am creating a directory of sorts with members and their profiles. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.