I am setting a template for the frontpage in a drupal 7 site and am having difficulty. I saved the file in the correct folder, cleared all caches, and refreshed both the theme page and browser page. Is there something I am missing? Why doesn't this work?
In Drupal 7, I believe you need page--front.tpl.php -- note the two dashes.
theme_get_suggestions(), which is called from template_preprocess_page() as theme_get_suggestions(arg(), 'page')
, contains the following code:
if (drupal_is_front_page()) {
// Front templates should be based on root only, not prefixed arguments.
$suggestions[] = $base . $delimiter . 'front';
}
$base
contains "page"
and $delimiters
contains "__"
. As the underscores are replaced with hyphens, the template filename for the front page must be page--front.tpl.php (two hyphens instead of one).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With