Drupal Form Theming Quick Tip
Very quickly, here's a useful tip if you're theming any kind of Drupal form. Just put the following in your overriding .tpl.php file
<?php print "<pre>"; print_r(array_values($form));print "</pre>"; ?>and it'll output a complete list of things you can theme.
Not ground breaking I know, but one of those things I can never seem to find when I want!





Hi, I'm Laurence and this is my Drupal blog.
Don't Make Me Think!
Pro Drupal Development
PHP Cookbook
Will You Please Be Quiet, Please?
with the devel module (http://drupal.org/project/devel) enabled it can be even as easy as "dvm($form)"
Or if you want to take it further and get ALL variables available within any of your .tpl.php file:
<pre><?php print_r(get_defined_vars()); ?></pre>Thanks guys, excellent suggestions!
I use this:
<?phpdrupal_set_message('<pre>'.print_r(array_values($form),true).'</pre>');
?>
var_dump ;)
Post new comment