show_current_template показывает только содержимое темплейта, установленного с помощью set_current_page_data_template, игнорируя SetTemplate

#
show_current_template показывает только содержимое темплейта, установленного с помощью set_current_page_data_template, игнорируя SetTemplate
Здравствуйте. Пытаюсь показать содержимое документа так, чтобы оно было окружено макетом. Не получается.
Страница выглядит так:
<?php

require_once('main_classes.php');

$kernel = & singleton('kernel');

// Загрузка модулей
$kernel->LoadModules();

// Идентификатор сайта
define('CURRENT_SITE', 2);

// Инициализация констант
$result = $kernel->InitConstants();

$kernel->SetTemplate(9); // макет

$documents = & singleton('documents');
$documents_version_row = $documents->GetCurrentDocumentVersion(24);
$documents_version_id = $documents_version_row['documents_version_id'];

$kernel->set_current_page($documents->GetDocumentVersionPath($documents_version_id));
$kernel->set_current_page_data_template(15); // шаблон
$kernel->set_CSS('templates/template9/style.css');
$kernel->show_current_template();

?>


Код темплейта (15.htm):

<?
$Structure = &singleton('Structure');

if (!defined('CURRENT_STRUCTURE_ID')) {
    define('CURRENT_STRUCTURE_ID', 113);
}

$structure_row = $Structure->GetStructureItem(CURRENT_STRUCTURE_ID);

$page_name = '';

if ($structure_row['documents_id'] > 0) {
    $page_name = get_doc_name($structure_row['documents_id']);
}

if((defined('IS_ERROR_404') && IS_ERROR_404) || is503error()) {
    $page_name = 'Ошибка!';
}

echo '<div class="header-page"><h1>' . $page_name . '</h1></div>';
$kernel->show_current_page();


В браузере, если открыть исходник страницы, можно увидеть
<div class="header-page"><h1>Ошибка 404</h1></div><div class="c-paragraf">
<p>Запрашиваемый документ не найден!</p>
<p>Перейдите на <a href="/" target="_self">главную страницу</a>.</p>
</div>


В общем, непонятно, почему не выводится макет, ведь я установил его с помощью
$kernel->SetTemplate(9); // макет


Спасибо заранее.
Авторизация