Page-front.tpl.php does not work

I am installing a template for the homepage on drupal 7 and am having difficulty. I saved the file in the correct folder, cleared all caches and updated both the theme page and the browser page. Is there something I'm missing? Why is this not working?

+6
source share
2 answers

In Drupal 7, I believe you need a page - front.tpl.php - pay attention to two dashes.

+26
source

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 "__" . Since underscores are replaced with hyphens, the template file name for the first page should be on the page - front.tpl.php (two hyphens instead of one).

+3
source

Source: https://habr.com/ru/post/900217/


All Articles