link to theme_...() documentation directly
marcvangend - August 12, 2008 - 09:09
| Project: | API |
| Version: | HEAD |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
In Drupal 6, the theme() function has become more complex. In D5, <?php theme('foo');?> used to call theme_foo(), but in D6, that is not necessarily true. This makes it harder to look up the code which returns the value for theme('foo').
Take theme_blocks() for instance (http://api.drupal.org/api/function/theme_blocks/6). It contains the following line:
$output .= theme('block', $block);The word 'theme' is nicely linked to http://api.drupal.org/api/function/theme/6, but what I'd really like to see documented here, is that the default code for this theme function can be found on http://api.drupal.org/api/file/modules/system/block.tpl.php/6/source. Would it be possible to enhance the UI, so that not only a link to the theme() documentation is provided, but also a link to the function or template that is called by theme('foo')?

#1
Yes, these links would be nice to have.
#2
#3
Thanks for moving the topic, I wasn't sure where to put it.
#4
Would this feature also include linking the code "theme('foo', ...)" to the theme_foo page?
That would be a huge timesaver!
#5
@ #4: Exactly, that's the idea. The only problem is, someone will have to code it first :-)
#6
I had a look at the parser inc file and it baffled me... turning the string "theme('foo'" into a link is fairly simple, though obviously picking whether to link to the 'theme_foo' page or the preprocess function or the tpl file is an extra complexity -- but where would that code need to go?
#7
#600198: Theme function API docs don't show where they are used marked as duplicate.