M
M
mixasnt2015-11-04 13:00:25
1C-Bitrix
mixasnt, 2015-11-04 13:00:25

How to hide the title on the news.detail page in Bitrix?

Hello.
There is a section: "Articles".
(Implemented as a page (stati.php) in the root of the site, where the bitrix:news component is called).
stati.php - also contains the header

<h1 class="page_title"><?$APPLICATION->ShowTitle("Статьи");?></h1>

When you go to the page of a separate article (news.detail), the same title is displayed.
<h1 class="page_title">Название статьи</h1>
Here, the h1.page_title class on the page of a separate article interferes with me.
Therefore, there is a desire to remove the "cross-cutting" h1 altogether and display it on a separate article page.
Here's how to do it humanly?
The option that came to mind is to call on the article page:
<script>
$('h1.page_title').remove();
</script>

But this is somehow not comme il faut. How to remove the header using Bitrix, or at least php?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2015-11-04
@f-end

Most likely, the header is written in the main site template at /bitrix/templates/template/header.php (most likely in the header file)
You need to get into it and remove something like this piece of code from there:

<?if ($curPage != SITE_DIR."index.php"):?>
        <h1><?=$APPLICATION->ShowTitle(false);?></h1>
        <?endif?>

After that, you need to add the code to the
component templates. For example, a detailed news template from a complex component will most likely be at:
/bitrix/templates/template/components/bitrix/news/.default/bitrix/news.detail/.default/
site in edit mode, select "Edit component template".
And here's another link . Will definitely come in handy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question