drupal
Accessing and Displaying Custom Profile Fields | Drupal 6
Here are some PHP snippets to display data from custom profile fields you can set up using the core profile module in Drupal 6. In this first example I have a custom user profile field that holds the user's location with the machine-readable name of profile_location. The first block of code stores the location of the user who is logged in in the variable theLocation. The second block of code displays this value.
<?php
global $user;
profile_load_profile($user);
$theLocation = $user->{profile_location};
?>
<?php print $theLocation; ?>
Drupal 6 Custom Theme Template
Here are some resources for creating a custom theme in Drupal 6.
The minimum files you need are:
- .info file
- page.tpl.php file
- template.php file
- CSS stylesheet
drupal 6 template.php
Here are a handful of PHP snippets to put in your template.php file to allow Drupal to use different page templates depending on your URL alias. It will also take the URL alias and add that to the bodyclasses array to help with customizing different pages through CSS. This is the best combination of snippets I have found to use in a completely custom theme. Just replace the four instances of THEMENAME with the name of your theme.