Answer the question
In order to leave comments, you need to log in
How to write GetCurPage in Bitrix?
It is necessary that the title is not displayed in this directory and nested in it, for example /news/1/ how to do this? The code below does not display only on the /news/ root directory, but on nested ones.
<? if ($APPLICATION->GetCurPage(false) == "/news/"): ?>
<? else: ?>
<h1 class="header_h1"><? $APPLICATION->ShowTitle(false); ?></h1>
<? endif ?>
Answer the question
In order to leave comments, you need to log in
if(CSite::InDir('/about/')) {
// condition for the /about/ directory and all its subdirectories, for example /about/contancs/
}
There is another approach, when a flag is set in the directory in the section properties file, for example:
/news/.section.php
<?
$sSectionName="Новости";
$arDirProperties = [
'HIDE_H1' => 'Y',
];
?>
<?php
if ('Y' != $APPLICATION->GetProperty('HIDE_H1')) {
?><h1><?$APPLICATION-ShowTitle(true);?></h1><?
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question