S
S
supertoliq2016-08-21 16:16:41
1C-Bitrix
supertoliq, 2016-08-21 16:16:41

Working with infoblocks, how to sort?

I have a 1s directory, it contains events. I need to display 6 upcoming events on the page.
How to set it up? outputs just as a directory, from the very first created event

<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">
 <br>
</blockquote>
   <?$APPLICATION->IncludeComponent(
  "bitrix:catalog.section",
  "main",
  Array(
    "ACTION_VARIABLE" => "action",
    "ADD_PROPERTIES_TO_BASKET" => "Y",
    "ADD_SECTIONS_CHAIN" => "N",
    "AJAX_MODE" => "N",
    "AJAX_OPTION_ADDITIONAL" => "",
    "AJAX_OPTION_HISTORY" => "N",
    "AJAX_OPTION_JUMP" => "N",
    "AJAX_OPTION_STYLE" => "Y",
    "BACKGROUND_IMAGE" => "-",
    "BASKET_URL" => "/personal/buy/",
    "BROWSER_TITLE" => "-",
    "CACHE_FILTER" => "Y",
    "CACHE_GROUPS" => "Y",
    "CACHE_TIME" => "36000000",
    "CACHE_TYPE" => "A",
    "CONVERT_CURRENCY" => "N",
    "DETAIL_URL" => "",
    "DISABLE_INIT_JS_IN_COMPONENT" => "N",
    "DISPLAY_BOTTOM_PAGER" => "Y",
    "DISPLAY_TOP_PAGER" => "N",
    "ELEMENT_SORT_FIELD" => "PROPERTY_BEGIN",
    "ELEMENT_SORT_FIELD2" => "SORT",
    "ELEMENT_SORT_ORDER" => "ASC",
    "ELEMENT_SORT_ORDER2" => "ASC",
    "FILTER_NAME" => "arEventsFilter",
    "HIDE_NOT_AVAILABLE" => "N",
    "IBLOCK_ID" => "4",
    "IBLOCK_TYPE" => "1c_catalog",
    "INCLUDE_SUBSECTIONS" => "Y",
    "LINE_ELEMENT_COUNT" => "3",
    "MESSAGE_404" => "",
    "META_DESCRIPTION" => "-",
    "META_KEYWORDS" => "-",
    "OFFERS_LIMIT" => "0",
    "PAGER_BASE_LINK_ENABLE" => "N",
    "PAGER_DESC_NUMBERING" => "N",
    "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
    "PAGER_SHOW_ALL" => "N",
    "PAGER_SHOW_ALWAYS" => "N",
    "PAGER_TEMPLATE" => ".default",
    "PAGER_TITLE" => "Товары",
    "PAGE_ELEMENT_COUNT" => "6",
    "PARTIAL_PRODUCT_PROPERTIES" => "N",
    "PRICE_CODE" => array(),
    "PRICE_VAT_INCLUDE" => "N",
    "PRODUCT_ID_VARIABLE" => "id",
    "PRODUCT_PROPERTIES" => array(),
    "PRODUCT_PROPS_VARIABLE" => "prop",
    "PRODUCT_QUANTITY_VARIABLE" => "",
    "PROPERTY_CODE" => array("","[END] Конец события","[SNOWCAT] Мест в ратраке","[BEGIN] Начало события","[TYPE] Тип события"),
    "SECTION_CODE" => "",
    "SECTION_ID" => "",
    "SECTION_ID_VARIABLE" => "SECTION_ID",
    "SECTION_URL" => "",
    "SECTION_USER_FIELDS" => array("",""),
    "SEF_MODE" => "N",
    "SET_BROWSER_TITLE" => "Y",
    "SET_LAST_MODIFIED" => "N",
    "SET_META_DESCRIPTION" => "Y",
    "SET_META_KEYWORDS" => "Y",
    "SET_STATUS_404" => "N",
    "SET_TITLE" => "Y",
    "SHOW_404" => "N",
    "SHOW_ALL_WO_SECTION" => "Y",
    "SHOW_PRICE_COUNT" => "1",
    "USE_MAIN_ELEMENT_SECTION" => "N",
    "USE_PRICE_COUNT" => "N",
    "USE_PRODUCT_QUANTITY" => "N"
  )
);?><br>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Harakhnin, 2016-08-23
@Chupokabr

What is not clear about the events. Look at the options. You have 4 fields

"ELEMENT_SORT_FIELD" => "PROPERTY_BEGIN",
    "ELEMENT_SORT_FIELD2" => "SORT",
    "ELEMENT_SORT_ORDER" => "ASC",
    "ELEMENT_SORT_ORDER2" => "ASC",

These are respectively 1 and 2 sorting elements. The field by which you sort and its direction is set.
1 sorting in this case (Field PROPERTY_BEGIN, direction ASC - ascending)
If these Events are of the news type, then it is better to use the news component

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question