hello Folks,
I am new to Drupal and I am trying to learn as much as I can as quickly as possible. I have many very dumb questions which I could really use some help with.

I've managed to get a rough understanding of the tpl files. As I understand it Drupal loads them in "cascading" fashion.
I am sure someone will have issues with this description, please correct me if this is not correct.

Anyway, my question(s) is / are as follows:
* When writing themes or modules I am not sure what data is available to me and how best to access it.
For example, how best do I show the themes name in footer in page.tpl.php?

* If I create a "content type" how do I best get the fields to display in page--contentTypeName.tpl.php

* Documentation question:
In reference to: http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_c...
On this page (and others) the documentation mentions a function. In this case drupal_common_theme. My question is, is this a function I should have access to in my *.tpl.php files? or do I have to implement this function? If so do I put the implementation in sites/< themeName >/includes/common.inc.

* another random question
What is the proper flow that drupal renders pages
Theme Engine > html.tpl.php > page.tpl.php > node.tpl.php > region.tpl.php > block.tpl.php > module.tpl.php

Comments

VM’s picture

A) data available - you can look at the core tpl.php files included in core modules, there are code comments inside the core files which should aid. Zen is also well documented in it's tpl.php files and may also be a place to start.

B) you can copy the default tpl.php can rename it

C) theme functions are placed in the theme's template.php file

footer, you can hardcode it, or you can place it in a block and place the block in the footer region. If the data isn't meant to change, hardcoding it isn't a bad way forward.

nazarioa’s picture

* A) and B) where can I copy these files from. I've been going into /drupal install root/modules/system for html.tpl.php, page.tpl.php , etc.

* C) huge help! does this mean that if I see something in the documentation where they say include/common.inc. I should implement that in template.php

* I want to avoid hard coding best I can.

VM’s picture

A) there are in the core modules folder contained within the subdirectory to which they are associated. Do a full file search for tpl.php to locate all tpl.php files on your system.

B) no. as that isn't a theme function. Why are your focusing on that function or using it as an example? If it's just an example, that one would be a bad one. Likely better off looking at theme.inc : http://api.drupal.org/api/drupal/includes%21theme.inc/function/theme/7 and http://api.drupal.org/api/drupal/modules%21system%21theme.api.php/group/...

http://drupal.org/theme-guide/6-7 is likely a better place to start with reference to themeing along with the zen theme @ http://drupal.org/project/zen and its documentation.

you will also want to investigate preprocess functions which go into template.php

nazarioa’s picture

Rereading old comments.
Wow, what a neweeb. Thank you!