Разделить page.tpl.php на несколько шаблонов.

Главные вкладки

Аватар пользователя dastan dastan 18 сентября 2011 в 17:18

Добрый день!
Возможно ли в друпале разделить page.tpl.php на несколько файлов, как header.tpl.php и sidebar.tpl.php и подключать их как инклудом.Поскольку приходится каждый раз менять во всех шаблонах, по несколько раз одно и тоже.

Комментарии

Аватар пользователя v1adimir@drupal.org v1adimir@drupal.org 18 сентября 2011 в 18:59

"dastan" wrote:
и подключать их как инклудом

Неправильно это как-то.

И в целом постановка задачи смущает, точно ли это архитектурно необходимо page.tpl.php разделять на header.tpl.php, sidebar.tpl.php...? С учетом того, что хэдеры и сайдбары в большинстве тем и так предусмотрены.

Но даже если и да, так и надо, я бы в сторону panels подумал.

Аватар пользователя xxandeadxx xxandeadxx 18 сентября 2011 в 19:29

"Cyber" wrote:
подхватит стандартные переменные?

"<a href="http://ru2.php.net/manual/en/function.include.php">http://ru2.php.net/manual/en/function.include.php</a>" wrote:
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.

Аватар пользователя Cyber Cyber 18 сентября 2011 в 19:37

"xxandeadxx" wrote:
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.

спасибо