Darrel O'Pry posted this gem on the Drupal Themes mailing list, and it deserves to be publicized.Paste this in your page.tpl.php below the <body> tag, to see what functions are available for you, the theme developer. <ul> <?php $functions = get_defined_functions(); foreach($functions['user'] as $function) : print "<li>$function</li>"; endforeach; ?> </ul> Similarly, one can use the get_defined_vars() and get_defined_constants() to see what variables are available. Now, use your imagination and build nice themes ...
Contents:
Comments
Tobias Maier (not verified)
List all themeable functions
Tue, 2005/12/06 - 09:07If you only want to list all themeable functions available try this:
< ? php- $function
- ";
$functions = get_defined_functions();
foreach($functions['user'] as $function):
if (strpos($function,'theme_') === 0):
print "
endif;
endforeach;
? >
Anonymous (not verified)
Module?
Tue, 2005/12/06 - 16:13This code would make a handy module
Erik Mallinson (not verified)
Hey, it works in a node!
Sat, 2006/01/21 - 18:44I've posted this code in a node for that on-the-go sort of reference.
List of themeable functions for Drupal 4.6.x"