Answer the question
In order to leave comments, you need to log in
Bitrix how to display the name of the infoblock section?
The site has a page with questions
site.com/voprosy.php - it contains a complex news component.
When I am on this page the title <?$APPLICATION->ShowTitle(false);?> "Questions" as it should.
When on the question page, the link of which looks like site.com/questions/here is the name of the section/here is the name of the entry itself/ everything is also ok. (site.com/questions/ - cnc refers to the file site.com/voprosy.php)
But when I am on the section page site.com/questions/ section name is here/ then <?$APPLICATION->ShowTitle(false); ?> is "Questions" and I want the section pages to display the name of the current section.
How to implement it?
Answer the question
In order to leave comments, you need to log in
I decided this:
At site/bitrix/templates/you-tmp/components/bitrix/news/name-tmp/bitrix/news.list/component_epilog.php - create a file with the following content ->
<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
if (is_array($arResult["SECTION"]["PATH"]))
{
$s = array_pop($arResult["SECTION"]["PATH"]);
$GLOBALS['APPLICATION']->SetTitle($s["NAME"]);
}
?>
In the component settings, as far as I remember, there are checkboxes: display the name of the section/element in the header. It should be in advanced settings.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question