A
A
Andrey2017-05-25 01:11:48
PHP
Andrey, 2017-05-25 01:11:48

How to make a filter by categories on 1c bitrix?

Good afternoon!
There is a page with brands, brands are displayed through the component:

<?$APPLICATION->IncludeComponent(
  "bitrix:news.list",
  "brands",
  Array(
    "DISPLAY_DATE" => "N",
    "DISPLAY_NAME" => "Y",
    "DISPLAY_PICTURE" => "N",
    "DISPLAY_PREVIEW_TEXT" => "N",
    "SEARCH_PAGE" => "/search/",
    "USE_RATING" => "N",
    "USE_SHARE" => "N",
    "TEMPLATE_THEME" => "green",
    "AJAX_MODE" => "N",
    "IBLOCK_TYPE" => "services",
    "IBLOCK_ID" => "11",
    "NEWS_COUNT" => "500",
    "SORT_BY1" => "NAME",
    "SORT_ORDER1" => "ASC",
    "SORT_BY2" => "SORT",
    "SORT_ORDER2" => "ASC",
    "FILTER_NAME" => "",
    "FIELD_CODE" => array(0=>"",1=>"",),
    "PROPERTY_CODE" => array(0=>"",1=>"",),
    "CHECK_DATES" => "Y",
    "DETAIL_URL" => "/brands/detail.php?ID=#ELEMENT_ID#",
    "PREVIEW_TRUNCATE_LEN" => "",
    "ACTIVE_DATE_FORMAT" => "d.m.Y",
    "SET_TITLE" => "Y",
    "SET_BROWSER_TITLE" => "Y",
    "SET_META_KEYWORDS" => "Y",
    "SET_META_DESCRIPTION" => "Y",
    "SET_LAST_MODIFIED" => "N",
    "INCLUDE_IBLOCK_INTO_CHAIN" => "N",
    "ADD_SECTIONS_CHAIN" => "N",
    "HIDE_LINK_WHEN_NO_DETAIL" => "N",
    "PARENT_SECTION" => "",
    "PARENT_SECTION_CODE" => "",
    "INCLUDE_SUBSECTIONS" => "N",
    "CACHE_TYPE" => "A",
    "CACHE_TIME" => "36000000",
    "CACHE_NOTES" => "",
    "CACHE_FILTER" => "N",
    "CACHE_GROUPS" => "Y",
    "PAGER_TEMPLATE" => ".default",
    "DISPLAY_TOP_PAGER" => "N",
    "DISPLAY_BOTTOM_PAGER" => "N",
    "PAGER_TITLE" => "Бренды",
    "PAGER_SHOW_ALWAYS" => "N",
    "PAGER_DESC_NUMBERING" => "N",
    "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
    "PAGER_SHOW_ALL" => "N",
    "PAGER_BASE_LINK_ENABLE" => "N",
    "SET_STATUS_404" => "N",
    "SHOW_404" => "N",
    "MESSAGE_404" => "",
    "AJAX_OPTION_JUMP" => "N",
    "AJAX_OPTION_STYLE" => "Y",
    "AJAX_OPTION_HISTORY" => "N",
    "COMPONENT_TEMPLATE" => "brands",
    "AJAX_OPTION_ADDITIONAL" => "",
    "MEDIA_PROPERTY" => "",
    "SLIDER_PROPERTY" => ""
  )
);?>

I want to make a filter by category on the left, something like this:
a99b835267124e4abb4b378090c3d6d0.png
more precisely, when you click on a category, so that brands are filtered by the selected category

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
likenoother, 2017-05-25
@likenoother

Alternatively, use a filter:
$GLOBALS['arrFilter']=array("SECTION_ID" => SECTION_ID);
and in the component call:
"USE_FILTER" => "Y",
"FILTER_NAME" => "arrFilter",
SECTION_ID can be passed as a GET parameter or done via CODE if the NC

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question