Drupal 7: How to check the available variables in a template (tpl) file
User login
Tuesday, April 23, 2013 - 20:12
There is a very handy php function that allows us to quickly check all the available variables in a tpl file (e.g. html.tpl.php).
Assuming that the devel module is installed, the following line should do the trick:
<?php kpr(get_defined_vars()); ?>
Alternatively, a print_r should work just fine:
<?php print_r(get_defined_vars()); ?>
More info: http://php.net/manual/en/function.get-defined-vars.php
Tags:
Drupal 7, Drupal Quick Tips