R
R
ragnar_ok2019-11-09 13:07:16
1C-Bitrix
ragnar_ok, 2019-11-09 13:07:16

How to make bitrix:news.list work with bitrix:catalog.filter when bitrix:catalog.filter is located below bitrix:news.list?

The bitrix:news.list and bitrix:catalog.filter components are called on the page .
You need to pass the value of the variable returned by bitrix:news.list to $arParams bitrix:catalog.filter . I solved the problem in the following way. However, now the filter, of course, does not work, since arFilter is now formed below bitrix:news.list .
Is this problem somehow solved?

$APPLICATION->ShowViewContent("filter");
$return = $APPLICATION->IncludeComponent(
  "bitrix:news.list",
  "",
  Array(
                "FILTER_NAME" => "arFilter",
    // ...
  )
);
ob_start();
$APPLICATION->IncludeComponent(
    "bitrix:catalog.filter",
    "",
    Array(
                "FILTER_NAME" => "arFilter",
    'RETURN' => $return,
    	// ...
    ),
    $component
);
$APPLICATION->AddViewContent("filter", ob_get_clean());

Explanation:
bitrix:news.list is customized. Now it returns its $arParams["AJAX_ID"]. I need to pass this AJAX_ID to bitrix:catalog.filter . Used by CAjax::GetForm(). That is, I need to pass the id of the updated area to bitrix:catalog.filter . Now I have to hardcode:
CAjax::GetForm("", "comp_7409d65e7fac8b82c3fb20e6ad6a4bca", "7409d65e7fac8b82c3fb20e6ad6a4bca");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
ragnar_ok, 2019-11-09
@ragnar_ok

It seems that without a double call of the same component, the task cannot be solved.
I solved the problem using jsAjaxUtil:

jsAjaxUtil.InsertFormDataToNode(this, 'comp_' + window.bxajaxid, false);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question