entering "page.tpl.php" either in the d.o. searchbox or into google yields page.tpl.php as the first link:
"This template defines the main skeleton for the page."
=== "Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu "God helps those who help themselves." -- Benjamin Franklin "Search is your best friend." -- Worldfallz
A very wide questions, so sorry if the following is too elementary.
page.tpl.php prints a page just like an html file, it has a header and a body just like an html file, it positions and styles stuff according to styles.css, just like an html file.
Unlike an html file, it contains <?php ... ?> parts, the content of which comes dynamically from drupal. These parts contain:
- Variables (content, links etc) with content depending on the page you are on, which need to be printed.
- Program code which controls what will or will not be printed, depending on the value of some variables.
Whatever is outside php tags is printed like normal html. Whatever is inside php tags is executed, evaluated, and printed or not. In the end all this will result in a normal html file as output. So, if you have designed an html template you need to insert php code to print the Drupal variables at the proper places.
Your page template defines the layout for a page. Where the columns start and end and what goes in each. The styling of the way a page looks is done in your css files.
Your page template file will link to other files and make calls for different variables. It is just the container for what will be your page.
It is not meant to be read like a regular html page. Most of it will be replaces when it is run.
Comments
entering "page.tpl.php"
entering "page.tpl.php" either in the d.o. searchbox or into google yields page.tpl.php as the first link:
"This template defines the main skeleton for the page."
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
A very wide questions, so
A very wide questions, so sorry if the following is too elementary.
page.tpl.php prints a page just like an html file, it has a header and a body just like an html file, it positions and styles stuff according to styles.css, just like an html file.
Unlike an html file, it contains
<?php ... ?>parts, the content of which comes dynamically from drupal. These parts contain:- Variables (content, links etc) with content depending on the page you are on, which need to be printed.
- Program code which controls what will or will not be printed, depending on the value of some variables.
Whatever is outside php tags is printed like normal html. Whatever is inside php tags is executed, evaluated, and printed or not. In the end all this will result in a normal html file as output. So, if you have designed an html template you need to insert php code to print the Drupal variables at the proper places.
Theme guide (Drupal 6)
http://drupal.org/theme-guide
Variables which can be used in the code in page.tpl.php
http://api.drupal.org/api/file/modules/system/page.tpl.php/6
other core templates recognize other variables
http://drupal.org/node/190815
And of course examining existing templates is invaluable.
Your page template defines
Your page template defines the layout for a page. Where the columns start and end and what goes in each. The styling of the way a page looks is done in your css files.
Your page template file will link to other files and make calls for different variables. It is just the container for what will be your page.
It is not meant to be read like a regular html page. Most of it will be replaces when it is run.