Customizing The User List Layout In Drupal

In this article we are going to understand how to override the default user list page layout while using phptemplate primarily based themes and also the profile.module. you’ll see the user list page after you go to any web address followed by ‘profile’ for example–

www.example.com/profile

With the utilization of this override it’s possible for you to manage the profile fields that are displayed and you’ll additionally control their positioning/layout.

Step 1

Open a text editor like notepad.exe, create a file named template.php with the utilization of the subsequent snippet. If you have already have a template.php file, simply add it to your existing one.

drupal-1

You must be sure to upload the template.php file to your active theme folder.

Step 2

The template.php snippet catches the default user list page layout before it’s displayed and it additionally appearance within the same folder for profile_profile.tpl.php file that determines the new layout.

A very simple example of a

profile_profile.tpl.php

file maybe illustrated as follows

Here the custom extended fields that are setup are called profile_city, profile_country, profile_postcode

drupal-2

Upload your profile_profile.tpl.php file to your active theme folder and go to your user list page at

www.example.com/profile

to view the new layout.

You can perform the following functions Once the process is complete:

According to your preference Name the classes or change the layout.
Edit your style.css file or whatever your main style sheet is termed so as to regulate the category designs.