Debugging: display all Drupal variables at the bottom of a page

Introduction

This is a very simple snippet I use to display all the Drupal variables available to a page when I'm testing/debugging a site.

Step 1 of 1

Using a text editor like Pspad or notepad, open up your node.tpl.php file and paste in the following snippet at the bottom of the file.

<?php
 
print '<pre>';
 
var_dump(get_defined_vars());
print
'</pre>';
?>

 
 

Drupal is a registered trademark of Dries Buytaert.