V
V
Vadim Timoshenko2020-03-01 21:32:51
1C-Bitrix
Vadim Timoshenko, 2020-03-01 21:32:51

How to make page hierarchy flat with SEF_MODE?

The bitrix:catalog component uses "SEF_MODE" => "Y" .

Initially, the settings are set to the following. options:

"SEF_URL_TEMPLATES" => array(
      "sections" => "",
      "section" => "#SECTION_CODE#/",
      "element" => "#SECTION_CODE#/#ELEMENT_CODE#/",
      "compare" => "",
      "smart_filter" => "",
    )


The list of elements at sitename.ru/#SECTION_CODE#/ work correctly.
I want the elements to open like this -> sitename.ru/#ELEMENT_CODE#/. So I write like this:

"SEF_URL_TEMPLATES" => array(
      "sections" => "",
      "section" => "#SECTION_CODE#/",
      "element" => "#ELEMENT_CODE#/",
      "compare" => "",


But for the elements, a 404 error pops up. Where to look for the answer? Inside the bitrix:catalog? Or am I missing something in the component parameters? Full code.

$APPLICATION->IncludeComponent(
  "bitrix:catalog", 
  ".default", 
  array(
    "COMPONENT_TEMPLATE" => ".default",
    "IBLOCK_TYPE" => "consult",
    "IBLOCK_ID" => "17",
    "SEF_MODE" => "Y",
    "SEF_FOLDER" => "/",
    "AJAX_MODE" => "N",
    "AJAX_OPTION_JUMP" => "N",
    "AJAX_OPTION_STYLE" => "Y",
    "AJAX_OPTION_HISTORY" => "N",
    "AJAX_OPTION_ADDITIONAL" => "",
    "CACHE_TYPE" => "A",
    "CACHE_TIME" => "36000000",
    "CACHE_FILTER" => "N",
    "CACHE_GROUPS" => "Y",
    "USE_MAIN_ELEMENT_SECTION" => "Y",
    "DETAIL_STRICT_SECTION_CHECK" => "N",
    "SET_LAST_MODIFIED" => "Y",
    "SET_TITLE" => "Y",
    "ADD_SECTIONS_CHAIN" => "Y",
    "ADD_ELEMENT_CHAIN" => "N",
    "COMPOSITE_FRAME_MODE" => "A",
    "COMPOSITE_FRAME_TYPE" => "AUTO",
    "USE_FILTER" => "N",
    "USE_REVIEW" => "N",
    "ACTION_VARIABLE" => "action",
    "PRODUCT_ID_VARIABLE" => "id",
    "USE_COMPARE" => "N",
    "PRICE_CODE" => array(),
    "USE_PRICE_COUNT" => "N",
    "SHOW_PRICE_COUNT" => "1",
    "PRICE_VAT_INCLUDE" => "Y",
    "PRICE_VAT_SHOW_VALUE" => "N",
    "BASKET_URL" => "",
    "USE_PRODUCT_QUANTITY" => "N",
    "PRODUCT_QUANTITY_VARIABLE" => "quantity",
    "ADD_PROPERTIES_TO_BASKET" => "Y",
    "PRODUCT_PROPS_VARIABLE" => "prop",
    "PARTIAL_PRODUCT_PROPERTIES" => "N",
    "PRODUCT_PROPERTIES" => array(),
    "SHOW_TOP_ELEMENTS" => "N",
    "SECTION_COUNT_ELEMENTS" => "Y",
    "SECTION_TOP_DEPTH" => "1",
    "PAGE_ELEMENT_COUNT" => "40",
    "LINE_ELEMENT_COUNT" => "1",
    "ELEMENT_SORT_FIELD" => "sort",
    "ELEMENT_SORT_ORDER" => "asc",
    "ELEMENT_SORT_FIELD2" => "id",
    "ELEMENT_SORT_ORDER2" => "desc",
    "LIST_PROPERTY_CODE" => array(
      0 => "TIME",
      1 => "PRICE",
      2 => "",
    ),
    "INCLUDE_SUBSECTIONS" => "Y",
    "LIST_META_KEYWORDS" => "-",
    "LIST_META_DESCRIPTION" => "-",
    "LIST_BROWSER_TITLE" => "-",
    "SECTION_BACKGROUND_IMAGE" => "-",
    "DETAIL_PROPERTY_CODE" => array(
      0 => "TABLEPRICE",
      1 => "",
    ),
    "DETAIL_META_KEYWORDS" => "-",
    "DETAIL_META_DESCRIPTION" => "-",
    "DETAIL_BROWSER_TITLE" => "-",
    "DETAIL_SET_CANONICAL_URL" => "Y",
    "SECTION_ID_VARIABLE" => "SECTION_ID",
    "DETAIL_CHECK_SECTION_ID_VARIABLE" => "N",
    "DETAIL_BACKGROUND_IMAGE" => "-",
    "SHOW_DEACTIVATED" => "N",
    "LINK_IBLOCK_TYPE" => "",
    "LINK_IBLOCK_ID" => "",
    "LINK_PROPERTY_SID" => "",
    "LINK_ELEMENTS_URL" => "link.php?PARENT_ELEMENT_ID=#ELEMENT_ID#",
    "USE_STORE" => "N",
    "PAGER_TEMPLATE" => ".default",
    "DISPLAY_TOP_PAGER" => "N",
    "DISPLAY_BOTTOM_PAGER" => "Y",
    "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" => "Y",
    "SHOW_404" => "Y",
    "FILE_404" => "",
    "COMPATIBLE_MODE" => "Y",
    "USE_ELEMENT_COUNTER" => "Y",
    "DISABLE_INIT_JS_IN_COMPONENT" => "Y",
    "SEF_URL_TEMPLATES" => array(
      "sections" => "",
      "section" => "#SECTION_CODE#/",
      "element" => "#ELEMENT_CODE#/",
      "compare" => "",
      "smart_filter" => "",
    )
  ),
  false
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael Lyamin, 2020-03-02
@BusteR27

In addition to the component settings, you need to set the same settings in the infoblock parameters

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question