How to Pull Profile Fields in Drupal

Drupal provides a free, open-source content management system software solution for website owners and developers. With the membership functionality of the software, members of your site can create profiles containing information such as name, interests and "about me." The information is a stored in a database. You can then pull the profile fields and have the information display on a Web page so others can view the profiles of members by calling the database to retrieve the data.

Instructions

    • 1

      Log in to your Web server using an FTP client on your computer.

    • 2

      Double-click your Drupal website folder from the Web server.

    • 3

      Copy and paste the "node.tpl.php" file to your desktop.

    • 4

      Click “Start,” “All Programs” and select “Notepad.”

    • 5

      Click “File” and select “Open.” Select the "node.tpl.php" file and click “Open.”

    • 6

      Copy and paste the following code at the beginning of the file:

      <?php
      $account = user_load(array('uid' => $node->uid));
      profile_load_profile($account);
      $firstName = $account->profile_first_name;
      $lastName = $account->profile_last_name;
      ?>

      Replace “profile_first_name” and "profile_last_name" with the desired profile fields you want to pull.

    • 7

      Click “File” and select “Save.”

    • 8

      Upload the saved "node.tpl.php" file to your Web server using an FTP client.

Related Searches:

References

Comments

Related Ads

Featured