(Tutorial) Drupal-Theming-and-Site-Building-Workshop-Notes
Tutorial : Drupal Theming and Site Building Workshop Notes
-
Last weekend we held our first hands on Drupal Theming and Site Building workshop. The workshop was a success in helping the participants fully visualize the process that is known as Drupal theming. Many contributed modules were covered like Views, Panels, CCK, Emfield and more. Special attention was given to the properly using template file overrides and working with the template.php file from the Zen theme.
Today I am posting some of the notes and code snippets that were used during instruction and demonstration for all to enjoy.
Basic Theme Variable Debugging
At the start of class we covered some basic PHP syntax and use and covered a few basic print functions that allow a themer to inspect which variables are available for outputting to the screen.
print_r
The following function is used very frequently to dump the contents of a variable (whether its type is boolean, string, integer, array, or object). Notice that passing a value of TRUE to the second parameter tells the function to return the contents instead of print to screen.
<?php
print_r($variable);
print '<pre>'. print_r($variable, TRUE) .'</pre>';
?>
Courtesy : http://boldsource.com
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)