N
N
ne_pes2019-11-06 03:29:44
1C-Bitrix
ne_pes, 2019-11-06 03:29:44

Why does the Bitrix infoblock element give a 404 error?

details.php:

<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Pipe");
?><?$APPLICATION->IncludeComponent(
  "site:news.detail",
  "",
      Array(
        "IBLOCK_TYPE" => "services",
        "IBLOCK_ID" => 14,
        "SORT_FIELD1" => "ACTIVE_FROM",
        "SORT_DIRECTION1" => "DESC",
        "SORT_FIELD2" => "SORT",
        "SORT_DIRECTION2" => "ASC",
        "ACTIVE_DATE_FORMAT" => "d.m.Y",
        "CACHE_TYPE" => "A",
        "CACHE_TIME" => "300",
        "CACHE_GROUPS" => "Y",
        "SEF_FOLDER" => "/serv/",
        "SEF_URL_TEMPLATES" => array(
            "element" => "#CODE#/",
        ),
        "TEMPLATE" => "page"
    )
);?><?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>

Infoblock settings:
5dc213e5018ed320918866.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Georgy Baruchyan, 2019-11-06
@Snatch87

Try "element" => "#CODE#/", replace with "element" => "#ELEMENT_CODE#/",
If it doesn't help:
as far as I understand, this is a complex component template, so do a var_dump of the arResult arrays before connecting the component and look at the VARIABLES array, under what key will the element code be there

D
Denis, 2019-11-06
@hanckey

Judging by the file name (detail.php), this component should be called as part of the complex bitrix:news, and the detail.php file itself should be inside the template of this complex component. But I see that the parameters are not inherited from $arParams, but are configured on the component directly. In addition, detail.php contains the header and footer of the template.
Where is this detail.php file located? Are you sure you placed the components correctly? Maybe you need to use this component as part of a complex one? If everything is correct, then most likely you need to check the address processing settings. Otherwise, there are simply no calls to the detail.php script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question