A
A
Anto2017-02-05 11:33:14
1C-Bitrix
Anto, 2017-02-05 11:33:14

How to prevent display of header on index.php?

Good afternoon!
Tell me how to disable the display of the title <?=$APPLICATION->ShowTitle(false);?> on the main page of the site, and allow it on internal pages.
<?=$APPLICATION->ShowTitle(false);?> in header.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Burlaka, 2017-02-05
@ZIROKUL

You can check the current url of the page and if it is the main page, do not display the title.
Current directory:
dev.1c-bitrix.ru/api_help/main/reference/cmain/get... Current
page:
dev.1c-bitrix.ru/api_help/main/reference/cmain/get...
which you do not need to display the header, there may be several, so as not to climb every time in the header, we track not the url, but some kind of variable.
For example:

if ( !defined ( "SKIP_TITLE" ) ) {
  $APPLICATION->ShowTitle(false);
}

and on the desired page, before connecting the prologue, we define a constant:
define( "SKIP_TITLE", true );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question