A
A
AAAA2015-10-23 00:18:38
1C-Bitrix
AAAA, 2015-10-23 00:18:38

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

3 answer(s)
A
AAAA, 2015-10-25
@AlexanderWalker

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"]);
}
?>

S
Sergey Ivchenko, 2015-10-23
@Serg89

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.

D
dber, 2020-04-15
@dber

In the infoblock settings on the SEO tab, you need to fill in the Section Title field, for example. like this: {=this.Name}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question