A
A
Alexey Nazarov2017-05-22 10:58:44
1C-Bitrix
Alexey Nazarov, 2017-05-22 10:58:44

How to organize news archive by date?

Hello. How to make a prefix with the publication date before the news link, as is done on Lenta.ru?
2e0a767ac1cb4b35948ed716ed149efd.jpg
And is it possible to make a news archive like Lentovskaya , with a date selection and a list of news by date? Editorial Bitrix: Small business.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Emelyanov, 2017-05-22
@atomicin

Plenty of options:

  • Create appropriate sections (+ hang a handler for saving/updating news so that it is automatically linked to the desired section and, if necessary, it is created by itself)
  • It is possible to save the string "/2017/05/22/moreluggage/" in the character code of the news, again using the handler
    and use it to build the CNC
  • You can also customize the bitrix:news component so that the complex component parses the url and connects news:detail with the necessary news

M
Maxim Pavlov, 2017-05-22
@Ifelseapps

Editing does not play a special role here. Offhand, this option comes to mind (the simplest one):
1) Via urlrewrite we send all requests of the form /news/xxxx/xx/xx/ to the file /news/index.php
2) Parse the url in urlrewrite and form 3 get -parameter (day, month, year)
3) In the file /news/index.php we call the news.list component, before the component we form a news filter by date, we pass the name of the filter through FILTER_NAME to the component.
1) Through urlrewrite we send all requests of the form /news/xxxx/xx/xx/xxxxxxxxx/ to the file /news/detail.php
2) Parse the url in urlrewrite and form a get-parameter that will contain the character code of the news.
3) In the /news/detail.php file, we call the news.detail component and pass the character code of the news to the ELEMENT_CODE parameter.
You can also customize the bitrix:news complex component or write your own.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question