S
S
Sherzod Abdurakhmonov2019-12-09 07:56:14
1C-Bitrix
Sherzod Abdurakhmonov, 2019-12-09 07:56:14

How to sort projects by year of their development??

The site has a section "Projects" ( https://uzeng.uz/ru/projects/). Each project has a "Project Development Year". So, how to make it so that when a user enters the "Projects" section, his projects are displayed by the "Year of project implementation" 2019 then 2018, 2017, 2016, etc. (i.e. first new projects, then old ones.)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mills, 2019-12-09
@mills

The easiest way is to create sections, display sections for the component, and shove your own project into each code.
By the way, the site does not open.

A
Anton, 2019-12-09
@anton99zel

If year is a property then sort by property and desc

$sortField = 'property_КОДСВОЙСТВА';
$sortOrder = 'desc'; 
"ELEMENT_SORT_FIELD" => $sortField,
"ELEMENT_SORT_ORDER" => $sortOrder,

If the year is part of some text, then pull out the year in php and add the year as a property through the Bitrix api, then as written above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question