M
M
mixasnt2015-10-22 10:49:40
1C-Bitrix
mixasnt, 2015-10-22 10:49:40

How to set up news.detail in Bitrix?

Hello.
I am working on a site managed by Bitrix.
The task is to create an information rubric, display the most viewed articles and all articles on the rubric page. On the subcategory page, you also need to display the most viewed and all, but from this subcategory.
Created an appropriate information block with the desired structure.
Then I placed 2 components on the stati.php page,
namely:

  • bitrix:news (display articles by number of views)
  • bitrix:news.list (display all news)

The stati.php page now looks like this:
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Статьи");
?>
<h1 class="page_title"><?$APPLICATION->ShowTitle()?></h1>
Популярные статьи:
<i>{bitrix:news}</i>
Все статьи:
<i>{bitrix:news.list}</i>
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>

I set up the CNC, everything seems to be fine, but!
On the page of the article itself, bitrix displays the material in the next. form:
<h1 class="page_title"><?$APPLICATION->ShowTitle()?></h1>
Популярные статьи:
{Текст текущей статьи}

Все статьи:
<i>{bitrix:news.list}</i>

This does not suit me at all, it is not entirely clear to me how Bitrix simply replaces the contents of the {bitrix:news} component with the text of the article when going to the article.
At the same time, keeping the "service text (Popular articles: ...)" on the article page, where it should not be.
Editing the news.detail page didn't help.
Please tell me what am I doing wrong?
Or what is the easiest way to get things done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-10-22
@mixasnt


Popular articles:
All articles:
Should be derived from the news.php file in the template of the complex component
Replaces it because it is not a physical page of the site, I generate code at the site of the complex component call and replaces only the call to the complex component templates

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question