Сортировка элементов информационного поля по дополнительным свойствам

GetIBlockElementList(29, false, Array("notice_date"=>"DESC"), 8);

 

или в параметрах компонента указываем в поле сортировки:

PROPERTY_<код свойства>

Пример:

<?$APPLICATION->IncludeComponent(
 "bitrix:news.list",
 "gazeta_v1",
 Array(
 "IBLOCK_TYPE" => "CDOW",
 "IBLOCK_ID" => "47",
 "PARENT_SECTION" => "",
 "NEWS_COUNT" => "20",
 "SORT_BY1" => "PROPERTY_DATE",
 "SORT_ORDER1" => "DESC",
 "SORT_BY2" => "PROPERTY_DATE",
 "SORT_ORDER2" => "DESC",
 "FILTER_NAME" => "",
 "FIELD_CODE" => array(0=>"",1=>"",),
 "PROPERTY_CODE" => array(0=>"date",1=>"",),
 "DETAIL_URL" => "news_detail.php?ID=#ELEMENT_ID#",
 "AJAX_MODE" => "N",
 "AJAX_OPTION_JUMP" => "N",
 "AJAX_OPTION_STYLE" => "Y",
 "AJAX_OPTION_HISTORY" => "N",
 "CACHE_TYPE" => "A",
 "CACHE_TIME" => "3600",
 "CACHE_FILTER" => "N",
 "PREVIEW_TRUNCATE_LEN" => "",
 "ACTIVE_DATE_FORMAT" => "d.m.Y",
 "DISPLAY_PANEL" => "N",
 "SET_TITLE" => "Y",
 "INCLUDE_IBLOCK_INTO_CHAIN" => "Y",
 "ADD_SECTIONS_CHAIN" => "Y",
 "HIDE_LINK_WHEN_NO_DETAIL" => "N",
 "DISPLAY_TOP_PAGER" => "N",
 "DISPLAY_BOTTOM_PAGER" => "Y",
 "PAGER_TITLE" => "Газета",
 "PAGER_SHOW_ALWAYS" => "Y",
 "PAGER_TEMPLATE" => "",
 "PAGER_DESC_NUMBERING" => "N",
 "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
 "DISPLAY_DATE" => "Y",
 "DISPLAY_NAME" => "Y",
 "DISPLAY_PICTURE" => "Y",
 "DISPLAY_PREVIEW_TEXT" => "Y",
 "AJAX_OPTION_ADDITIONAL" => ""
 )
);?>


comments powered by Disqus

Популярное