Mostly, I'm looking for a "What's In. What's Out" overview?

e.g. [themename].info is in. _phptemplate_variables() is out.

I spent a lot of hours reading Converting 5.x themes to 6.x and Theme developers guide Drupal 6, and also watching http://drupaldojo.com/lesson/new-stuff-in-drupal-6-theming.

They have been informative (and I don't know if its the way things are presented, insufficient information, or because I'm not a PHP developer) but I'm not entirely convinced of the claim that theming is better in D6 :(

For example:
- What is optional/mandatory in [themename].info
- What is theme function registering about? And why is it needed?
- Is there a key to http://drupal.org/files/theme_flow_5_1.pdf and http://drupal.org/files/theme_flow_6_1.pdf? What are the red/grey/solid/dashed/dotted lines representing? Are there any examples to accompany the PDFs.
- Since the default implementation of the hook can be a "function" or "template" now, it is recommended that you provide new "preprocess functions" (variable functions similar to _phptemplate_variables() in Drupal 5.) when overriding as a "template" for the theme when the original implementation is done as a "function". If the original implementation is done as a "template", then simply copying the file is all that's needed. - What?
- What is manually registering hooks and how is it done?
- Are the 6.x equivalents for page.tpl.php, node.tpl.php, block.tpl.php, etc.

Comments

kulfi’s picture

Still looking for help ...

merlinofchaos’s picture

- What is optional/mandatory in [themename].info

The only thing that's mandatory in the .info is the theme name and probably the engine. Technically it's optional but you almost certainly want phptemplate.

- What is theme function registering about? And why is it needed?

It's primarily a performance enhancement; the process of discovering the theme functions and templates can take some time. Doing it in advance and caching it saves processing time. It also allows a lot more flexibility from the developer side.

Since the default implementation of the hook can be a "function" or "template" now, it is recommended that you provide new "preprocess functions" (variable functions similar to _phptemplate_variables() in Drupal 5.) when overriding as a "template" for the theme when the original implementation is done as a "function". If the original implementation is done as a "template", then simply copying the file is all that's needed.

This is a note for module developers recommending that they provide preprocess functions for the themes even if they aren't in use because the module chose to use a theme function rather than a template.

What is manually registering hooks and how is it done?

It is using hook_theme() to register your theme hooks. Generally only modules need to do this, not themes.

- Are the 6.x equivalents for page.tpl.php, node.tpl.php, block.tpl.php, etc.

This sentence is incomplete. If it's supposed to be "Are there" then the answer is yes. If it's not, I don't understand the question.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

kulfi’s picture

Thanks for the clarifications! I suspected some of the points that I wasn't grokking was related to module development, not theming.

Are the 6.x equivalents for page.tpl.php, node.tpl.php, block.tpl.php, etc.

Should read: Are there 6.x equivalents for page.tpl.php, node.tpl.php, block.tpl.php, etc. That is, is there a handbook page/list of variables per scope available for Drupal 6 theming?

A "whats in/whats out" overview would still be hugely helpful. My current level of understanding precludes me from contributing one though :(

gpk’s picture

>That is, is there a handbook page/list of variables per scope available for Drupal 6 theming?
http://drupal.org/node/11816#comment-675411 shows how to find out what variables are available. You could help by documenting this perhaps?

>A "whats in/whats out" overview would still be hugely helpful
It's probably on the documentation team's issue list. If not, I suggest you raise an issue http://drupal.org/node/add/project-issue/documentation against the documentation project.

gpk
----
www.alexoria.co.uk