N
N
newked2021-03-05 12:26:09
1C-Bitrix
newked, 2021-03-05 12:26:09

How to hide news sections on Bitrix detail page?

Guys, I need your help. Help me to understand. I’ll emphasize right away ... I’m new in Bitrix.
In general, a problem appeared, which seems to be unpretentious, but I can’t solve it, I’m ashamed. I need to create blogs on the site.
The most important template is the following structure:
1. header.php
2. content - one large column
3. footer.php

I need to collect blogs so that on some pages information is displayed in two columns, and on some in one .

As implemented now:

www.site.ru/blog/ - blog sections are displayed here in the full width of the content (in one column). I implemented this using the bitrix:catalog.section.list component.

www.site.ru/blog/articles/ - everything should be displayed here in two columns. I created in a folderblog folder articles and in it I made index.php with a header and a footer, respectively. I added html layout to this file, which is responsible for two columns. The first column is responsible for displaying the entire list of articles and displaying the list of articles from the selected section (inserted the bitrix:news complex component), the second for displaying blog sections (inserted the bitrix:catalog.section.list component)

www.site.ru/blog/articles/ CNC_ELEMENT - here I display detailed news. I need to display the article in one column in full width, but it is displayed in two columns (the article is displayed in detail on the left, sections remain on the right). I need to hide the sections and display the article in detail in full width.

Here's how to do it?! I can not figure it out, help people good advice.

P/S Guys, I do not rule out that maybe I did not choose the right bitrix:news complex template to implement the task. I can't figure it out. just started to master Bitrix.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
newked, 2021-03-05
@newked

And the solution turned out to be simple.
It turns out that I started making edits in the wrong place .... I copied the template of the COMPLEX component bitrix:news and edited files NOT news.php and detail.php, but edited exactly MY_TEMPLATE/bitrix/news.list/.default/template.php (list output) and MY_TEMPLATE/bitrix/news.detail/.default/template.php (detailed output). Of course, they will also need to be changed, but first it was necessary to set, so to speak, a framework for displaying a list of news.
those. I added two columns to news.php - in one column the Application responsible for displaying the list should be inserted, in the second column the application responsible for displaying sections.
well, you don’t need to touch detail.php at all yet ... everything will be fine there and it will be necessary to edit just MY_TEMPLATE/bitrix/news.detail/.default/template.php, i.e. pure material output template

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question