Well, I'm creating my first template for Drupal...

I've read everything here: http://drupal.org/node/11774
I've watched a rather interesting screencast from Matt Westgate "Dojo Lesson 28 - Theming Like A Pro!"

Everything is quite clear, but there is a question that I think is not covered adequately.

For example here is a page that describes page.tpl.php variables:
http://drupal.org/node/11812

Well, let's leave aside a matter that the descriptions are not fully informative (the required answers can be found by searching), but there's another important matter which is almost missing.

I'm talking about overriding theme functions.

The above location gives only this:
http://drupal.org/node/55126

- which (I think you'll agree) is a very compact form of addressing an issue like this.

OK, that's where the Matt's lesson helps - in it he describes how to override a function (starting with theme_), how to paste it to template.php and then how to change it, use it and even create a separate template file (like, for example, breadcrumb.tpl.php), using _phptemplate_callback.

Great, but... Wouldn't it be better for the page containing page.tpl.php variables description (and other such pages) to state WHERE they are originally set (by default)?

It's important, because in order to override a function one should first take a look at it's default shape - and then copy-paste-change it.

For example, $breadcrumb is set by a function in includes/theme.inc. Another variable - in another place. And so on.

You may say that there's api.drupal.org - where the locations are stated explicitly.

Yes, but it's not easy to find the necessary information there.

For instance, if I type "breadcrumb" in the search box, all is well, and theme_breadcrumb comes up automatically.

But what if I need to change $tabs? The search yields nothing.

Also, let's say I need to change $search_button_text (I'm creating a site with two languages, and I need a custom string to appear on the search button in each language). I can't find it either!

So my question is - is there a place somewhere where there's a good reference about the location of all themable functions?

Not this one (for the reasons explained above):
http://api.drupal.org/api/group/themeable/5

I thinking of something like this:
----------------------------
Page.tpl.php
Available variables (Alphabetical)

$base_path
Description: Returns the base URL path of the Drupal installation. At the very least, this will always default to /.
The default is set by a function in this location: some location

$breadcrumb
Description: HTML for displaying the breadcrumbs at the top of the page.
The default is set by a function in this location: some location
....

and so on

----------------------------

Thank you!

Comments

kulfi’s picture

subscribing

Danic’s picture

subscribing

CMatters’s picture

Ditto. The issue is compounded when you want to theme something a module (such as Views) has created.