Помогите разобраться с вставкой PHP для установки модуля page_title

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

Аватар пользователя datych datych 31 марта 2009 в 20:17

PHP не знаю, но вроле Drupal до сих пор и не требовал знания PHP. А сейчас столкнулся с задачкой - при установке модуля page title.

Мне предлагается вставить код в шаблон темы, чтобы заработал модуль по индивидуальной настройке титула страниц:

4. The page title is ultimately set at the theme level. To let your PHPTemplate
   based theme interact with this module, you need to add some code to the template.php
   file that comes with your theme. If there is no template.php file, you can simply
   use the one included with this download. Here is the code:

function _phptemplate_variables($hook, $vars) {
  $vars = array();
  if ($hook == 'page') {

    // These are the only important lines
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }

  }
  return $vars;
}

  As you can see from the code comment, there are only three important lines
  of code:

  if (module_exists('page_title')) {
    $vars['head_title'] = page_title_page_get_title();
  }

  These lines need to be added to the 'page' hook of the _phptemplate_variables
  function.

  Alternately, you can call page_title_page_get_title() from page.tpl.php
  directly at the place where the title tag is generated.

template.php у моей темы нет, и значит я должен сделать следующее:
"Alternately, you can call page_title_page_get_title() from page.tpl.php directly at the place where the title tag is generated." (Из readme модуля).

??

Буду очень благодарен...

Титул у меня в page.tpl.php выглядит так:
<title><?php print $head_title ?></title>

Комментарии