Changing the layout of a page using page.tpl.php
As we have seen in earlier chapters, the page template file, page.tpl.php
, is responsible for the overall layout and markup of a Drupal page. Besides the basic HTML headers, various elements common to all pages in the site, such as the layout of regions, headers, footers, logos, slogans, breadcrumbs, and so on are, all positioned here.
In this recipe, we will look at modifying the page template file in order to move the search form—another element which is normally present across all pages—from the header to the footer.
Getting ready
It is possible that some themes will not have a page.tpl.php
file of their own. This is usually because they are sub-themes and the template file will need to be imported from the base theme, as we saw in the last chapter. In other cases, using modules/system/page.tpl.php
as a foundation is usually a good idea. Themers looking for a little adventure can, of course, create one from scratch!
The search module needs...