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; ?>

Read more...

1 Comment
Mon, 07/20/2009
Posted in

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
Read more...

1 Comment
Mon, 06/29/2009
Posted in

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.

Read more...

0 Comments
Wed, 01/28/2009
Posted in

© 2010 Sam Wirch | Contact | Home