Answer the question
In order to leave comments, you need to log in
How to change title in browser window?
in the news.detail template I write
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?
$APPLICATION->SetPageProperty("title", "hi");
Answer the question
In order to leave comments, you need to log in
A popular mistake is that deferred functions are called in the component template: $APPLICATION->SetTitle(), $APPLICATION->AddChainItem(), etc. In this case, they only work when caching is disabled.
You need to do this
in result_modifier.php
$arResult["CUSTOM_TITLE"] = $arResult["NAME"]; //Тут формируйте свой заголовок
$cp = $this->__component;
if (is_object($cp)) {
$cp->SetResultCacheKeys(array(
"CUSTOM_TITLE",
));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question