S
S
sickgang2021-05-15 18:20:30
1C-Bitrix
sickgang, 2021-05-15 18:20:30

How to open the detail view page of an element?

There is such a call to the bitrix:catalog.section component

<? if (!defined("B_PROLOG_INCLUDED") || (B_PROLOG_INCLUDED!==true)) die(); ?>

<?$APPLICATION->IncludeComponent(
  "bitrix:catalog.section", 
  "restaurant-index", 
  array(
    "IBLOCK_TYPE" => "restaurants",
    "IBLOCK_ID" => "7",
    "SECTION_ID" => "",
    "SECTION_CODE" => LANGUAGE_ID,
    "SECTION_USER_FIELDS" => array(
      0 => "",
      1 => "",
    ),
    "ELEMENT_SORT_FIELD" => "sort",
    "ELEMENT_SORT_ORDER" => "asc",
    "ELEMENT_SORT_FIELD2" => "id",
    "ELEMENT_SORT_ORDER2" => "asc",
    "FILTER_NAME" => "arrFilter",
    "INCLUDE_SUBSECTIONS" => "N",
    "SHOW_ALL_WO_SECTION" => "N",
    "PAGE_ELEMENT_COUNT" => "100",
    "LINE_ELEMENT_COUNT" => "",
    "PROPERTY_CODE" => array(
      0 => "PHOTOGALLERY",
      1 => "CAPACITY",
      2 => "",
    ),
    "OFFERS_LIMIT" => "5",
    "SECTION_URL" => "",
    "DETAIL_URL" => "",
    "SECTION_ID_VARIABLE" => "SECTION_ID",
    "AJAX_MODE" => "N",
    "AJAX_OPTION_JUMP" => "N",
    "AJAX_OPTION_STYLE" => "N",
    "AJAX_OPTION_HISTORY" => "N",
    "CACHE_TYPE" => "A",
    "CACHE_TIME" => "36000000",
    "CACHE_GROUPS" => "Y",
    "SET_META_KEYWORDS" => "Y",
    "META_KEYWORDS" => "-",
    "SET_META_DESCRIPTION" => "Y",
    "META_DESCRIPTION" => "-",
    "BROWSER_TITLE" => "-",
    "ADD_SECTIONS_CHAIN" => "N",
    "DISPLAY_COMPARE" => "N",
    "SET_TITLE" => "N",
    "SET_STATUS_404" => "N",
    "CACHE_FILTER" => "Y",
    "PRICE_CODE" => array(
    ),
    "USE_PRICE_COUNT" => "Y",
    "SHOW_PRICE_COUNT" => "1",
    "PRICE_VAT_INCLUDE" => "Y",
    "BASKET_URL" => "/personal/basket.php",
    "ACTION_VARIABLE" => "action",
    "PRODUCT_ID_VARIABLE" => "id",
    "USE_PRODUCT_QUANTITY" => "Y",
    "PRODUCT_QUANTITY_VARIABLE" => "quantity",
    "ADD_PROPERTIES_TO_BASKET" => "Y",
    "PRODUCT_PROPS_VARIABLE" => "prop",
    "PARTIAL_PRODUCT_PROPERTIES" => "N",
    "PRODUCT_PROPERTIES" => array(
    ),
    "PAGER_TEMPLATE" => "",
    "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",
    "AJAX_OPTION_ADDITIONAL" => "",
    "SET_BROWSER_TITLE" => "Y",
    "COMPONENT_TEMPLATE" => "restaurant-index",
    "BACKGROUND_IMAGE" => "-",
    "SEF_MODE" => "N",
    "SEF_RULE" => "",
    "SECTION_CODE_PATH" => "",
    "SET_LAST_MODIFIED" => "N",
    "USE_MAIN_ELEMENT_SECTION" => "N",
    "COMPOSITE_FRAME_MODE" => "A",
    "COMPOSITE_FRAME_TYPE" => "AUTO",
    "PAGER_BASE_LINK_ENABLE" => "N",
    "SHOW_404" => "N",
    "MESSAGE_404" => "",
    "COMPATIBLE_MODE" => "Y",
    "DISABLE_INIT_JS_IN_COMPONENT" => "N"
  ),
  false
);
?>

The page displays all the elements from this infoblock, everything is ok.
But when you go to the detailed view page, a 404 error is generated.
Detailed view output settings for the infoblock element:
<?
global $baseSectionFilter;
$APPLICATION->IncludeComponent(
    "bitrix:catalog.section",
    "restaurant-detail",
    Array(
        "IBLOCK_TYPE" => "restaurants",
        "IBLOCK_ID" => "7",
        "SECTION_ID" => "",
        "SECTION_CODE" => LANGUAGE_ID,
        "SECTION_USER_FIELDS" => array(),
        "ELEMENT_SORT_FIELD" => "sort",
        "ELEMENT_SORT_ORDER" => "asc",
        "ELEMENT_SORT_FIELD2" => "id",
        "ELEMENT_SORT_ORDER2" => "asc",
        "FILTER_NAME" => "baseSectionFilter",
        "INCLUDE_SUBSECTIONS" => "Y",
        "SHOW_ALL_WO_SECTION" => "N",
        "PAGE_ELEMENT_COUNT" => "100",
        "LINE_ELEMENT_COUNT" => "",
        "PROPERTY_CODE" => array(
            "PHOTOGALLERY",
            "CAPACITY"
        ),
        "OFFERS_LIMIT" => "5",
        "SECTION_URL" => "",
        "DETAIL_URL" => "",
        "BASKET_URL" => "/personal/basket.php",
        "ACTION_VARIABLE" => "action",
        "PRODUCT_ID_VARIABLE" => "id",
        "PRODUCT_QUANTITY_VARIABLE" => "quantity",
        "PRODUCT_PROPS_VARIABLE" => "prop",
        "SECTION_ID_VARIABLE" => "SECTION_ID",
        "AJAX_MODE" => "N",
        "AJAX_OPTION_JUMP" => "N",
        "AJAX_OPTION_STYLE" => "N",
        "AJAX_OPTION_HISTORY" => "N",
        "CACHE_TYPE" => "A",
        "CACHE_TIME" => "36000000",
        "CACHE_GROUPS" => "N",
        "META_KEYWORDS" => "-",
        "META_DESCRIPTION" => "-",
        "BROWSER_TITLE" => "-",
        "ADD_SECTIONS_CHAIN" => "N",
        "DISPLAY_COMPARE" => "N",
        "SET_TITLE" => "N",
        "SET_STATUS_404" => "N",
        "CACHE_FILTER" => "Y",
        "PRICE_CODE" => array(),
        "USE_PRICE_COUNT" => "Y",
        "SHOW_PRICE_COUNT" => "1",
        "PRICE_VAT_INCLUDE" => "Y",
        "PRODUCT_PROPERTIES" => array(),
        "USE_PRODUCT_QUANTITY" => "Y",
        "QUANTITY_FLOAT" => "N",
        "DISPLAY_TOP_PAGER" => "N",
        "DISPLAY_BOTTOM_PAGER" => "N",
        "PAGER_TITLE" => "",
        "PAGER_SHOW_ALWAYS" => "N",
        "PAGER_TEMPLATE" => "",
        "PAGER_DESC_NUMBERING" => "N",
        "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
        "PAGER_SHOW_ALL" => "N",
        "AJAX_OPTION_ADDITIONAL" => ""
    ),
    false
);?>

Settings in the infoblock: I
609fe6451ce1c528622443.png
compared it with exactly the same infoblock, as if everything is identical, and there, when you go to the element, it opens, but it does not work in this infoblock...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sickgang, 2021-05-16
@sickgang

Solved by adding a regular expression in the admin panel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question