H
H
Hy_ok2017-06-02 05:38:48
1C-Bitrix
Hy_ok, 2017-06-02 05:38:48

How to sort articles by author?

in general, I have been working with Bitrix recently, or rather, this is generally the first project on it, and I encountered such a problem when you go to the article, to the detailed view, it displays the author, you need to make it so that when you click on the author, the page opens and on it there were all the articles of this author, well, as I understand it, you need to create a separate section, create a component that will take data about the author, and make a query to the database with a selection and by field, placing the component on the page is not a problem, the problem is that there is there is a Getlist() function in Bitrix, and you can add selection conditions in it, but it doesn’t say whether it can be done by the author, Google and Yandex did not give any results, well, I will transfer user data to the page of this kind of search with get parameters and in I will already collect them in the component,can anyone tell me how to make this selection?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Pavlov, 2017-06-02
@hy_ok

By passing the author's get parameter, you must build the filter through a global variable before calling the component. The name of this variable is passed to the FILTER_NAME component parameter.
See the example mattweb.ru/item/94-ispolzuem-massiv-filter-vnutri-...
What to pass to the filter?
If the author is the Id of the user who created the element:
CREATED_USER_ID or CREATED_BY - by the ID of the user who added the element (Number filter);
If the author is a property of the element (for example, it is called USER):
PROPERTY_USER
PS To understand how this filtering method works, open the news.list component code and find the place where it handles FILTER_NAME.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question