Answer the question
In order to leave comments, you need to log in
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?
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
Plenty of options:
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 questionAsk a Question
731 491 924 answers to any question