By runeveryday on
i found variable $site_fields ,$site_html in the page.tpl.php .according to drupal theme convention,if in the tpl.php file,we use a variable,there must be a function in template.php to deal with it. but in garland theme i can't find the function which deal with the variable $site_fields ,$site_html ....any tips would be appreciated.
Comments
In the code
Those are not provided to page.tpl.php. They are created inside of Garland's page.tpl.php.
$site_fields this is a new
$site_fields this is a new variable. not available in page.tpl.php. i can't understand about your said. i know you listing code is in page.tpl.php. but a new variable must be by template.php registered. am i right ?
It is in page.tpl.php.
It is in page.tpl.php. $site_fields and $site_html are being defined as you go along. Here's where they are each defined:
See, $site_fields is being defined as an array and $site_html is the result of joining all the values in the $site_fields array with no delimiters.
thank you very much,but
thank you very much,but according to " but to keep the .tpl.php files tidy it can be used to hold preprocessors for generating variables before they are merged with the markup inside .tpl.php files. " why,there is no preprocessors for generating the two above variables .
I think the main problem is
I think the main problem is that you don't really know how to program in PHP? You should read up on some programming - it will definitely help you with this because you are asking questions that are basic to programming. PHP is the "pre-processor" that the quote is referring to. The parts I quoted earlier shows when the variable is being created. The variable doesn't exist until that part of the code. Alternatively, don't theme with Garland. Try a simpler one such as Bluemarine and slowly work your way up in difficulty.