T
T
tuxx2014-09-19 12:13:36
PHP
tuxx, 2014-09-19 12:13:36

How to set up CNC with detailed news view and pagination?

The problem is that I can't set up both pagination and detail view at once. For a detailed view, I enable the CNC in the settings of the bitrix:news component and set #ELEMENT_CODE#/ for the detailed view page and the CNC directory /dir/ . For page-by-page navigation, I change links like /dir/?PAGEN_1=2 to /dir/page-2/ in bitrix:system.pagenavigation and add the corresponding rule in the rule processing settings. As a result, I have this set of rules in urlrewrite.php for /dir/ :

array(
    "CONDITION" => "#^/proyekty/page-([0-9]+)/#",
    "RULE" => "PAGEN_1=\$1",
    "ID" => "",
    "PATH" => "/proyekty/index.php",
  ),
array(
    "CONDITION" => "#^/proyekty/((?!page-)(.+))/#",
    "RULE" => "ELEMENT_CODE=\$1",
    "ID" => "",
    "PATH" => "/proyekty/index.php",
  ),
array(
    "CONDITION" => "#^/proyekty/#",
    "RULE" => "",
    "ID" => "bitrix:news",
    "PATH" => "/proyekty/index.php",
  ),

The error is generated by the bitrix:news component. When commenting out the SEF_MODE and SEF_FOLDER parameters of the component, the navigation works, but then the detail view links break and instead of #ELEMENT_CODE# ?=#ELEMENT_ID # is substituted and the link becomes similar to /dir/?=212

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2015-06-11
Madzhugin @Suntechnic

Do not use SEF_MODE. And check what is set in the infoblock settings. In sense what there addresses of pages.

D
Denis Gorokhov, 2018-05-04
@gorokhov_dv

Good afternoon, maybe someone will come in handy. Developed the "CNC pagination" module, just solves this problem, thanks!
Link to the module: https://gorokhov.su/modules/pagen/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question