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
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

drumm - August 12, 2008 - 15:06
Project:Drupal.org infrastructure» API
Version:<none>» HEAD
Component:Other» User interface

Yes, these links would be nice to have.

#2

drumm - August 12, 2008 - 15:06
Title:api.drupal.org: link to theme() documentation directly» link to theme_...() documentation directly

#3

marcvangend - August 12, 2008 - 21:17

Thanks for moving the topic, I wasn't sure where to put it.

#4

joachim - May 11, 2009 - 14:54

Would this feature also include linking the code "theme('foo', ...)" to the theme_foo page?
That would be a huge timesaver!

#5

marcvangend - May 11, 2009 - 19:23

@ #4: Exactly, that's the idea. The only problem is, someone will have to code it first :-)

#6

joachim - May 11, 2009 - 21:51

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

NancyDru - October 15, 2009 - 13:03
 
 

Drupal is a registered trademark of Dries Buytaert.