Get all defined variables in drupal template files (tpl.php)
This is how you can get all defined variables in a template file like node.tpl.php in your theme folder by using get_defined_vars().
<?php
//In a PHP secion of the code
?>
<pre>
<?php
print_r(get_defined_vars());
?>
</pre>
<?php
?>
It will return someting like this:
Array
(
[template_file] => sites/all/themes/extended/weather.tpl.php
[variables] => Array
(
[template_files] => Array
(
)
[weather] => Array
(
[real_name] => Lulea / Kallax
[condition] => Klar himmel
[image] => Array
(
[filename] => /sites/all/modules/weather/images/day-clear.png
[size] => width="64" height="64"
)
[temperature] => -16 °C
[wind] => Varierande, 1 meter/s
[pressure] => 1030 hPa
[rel_humidity] => 84 %
[visibility] => 10 km
[sunrise] => Soluppgång: 06:22 GMT
[sunset] => Solnedgång: 15:11 GMT
[metar] => 2011/02/20 13:50
...Knowledge keywords:
