Добрый день!
Возможно ли в друпале разделить page.tpl.php на несколько файлов, как header.tpl.php и sidebar.tpl.php и подключать их как инклудом.Поскольку приходится каждый раз менять во всех шаблонах, по несколько раз одно и тоже.
И в целом постановка задачи смущает, точно ли это архитектурно необходимо page.tpl.php разделять на header.tpl.php, sidebar.tpl.php...? С учетом того, что хэдеры и сайдбары в большинстве тем и так предусмотрены.
Но даже если и да, так и надо, я бы в сторону panels подумал.
When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward. However, all functions and classes defined in the included file have the global scope.
When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward. However, all functions and classes defined in the included file have the global scope.
Комментарии
можно
ну и как?
Неправильно это как-то.
И в целом постановка задачи смущает, точно ли это архитектурно необходимо page.tpl.php разделять на header.tpl.php, sidebar.tpl.php...? С учетом того, что хэдеры и сайдбары в большинстве тем и так предусмотрены.
Но даже если и да, так и надо, я бы в сторону panels подумал.
include('header.tpl.php');
include('sidebar.tpl.php');
подхватит стандартные переменные? пробовал?
Часто так делаю, не было проблем.
спасибо