U
U
ultimate_ramzes2017-04-19 13:18:52
PHP
ultimate_ramzes, 2017-04-19 13:18:52

Bitrix CNC component problem?

It is required to output articles using the bitrix:news component. Announcements are displayed, the link is generated correctly /knowledge-base/articles/test1/, and when you click on the link, you get 404. In the infoblock settings, the URL of the information block page is set: knowledge-base, section: articles. Tell me what's the problem

<?
$APPLICATION->IncludeComponent("bitrix:news", ".default", array(
  "IBLOCK_TYPE" => "dynamic_content",
  "IBLOCK_ID" => "34",
  "SECTION_CODE"=>'articles',
  "NEWS_COUNT" => "10",
  "USE_SEARCH" => "N",
  "USE_RSS" => "N",
  "USE_RATING" => "N",
  "USE_CATEGORIES" => "N",
  "USE_FILTER" => "N",
  "SORT_BY1" => "ACTIVE_FROM",
  "SORT_ORDER1" => "DESC",
  "SORT_BY2" => "SORT",
  "SORT_ORDER2" => "ASC",
  "CHECK_DATES" => $check_dates,
  "SEF_MODE" => "Y",
  "SEF_FOLDER" => "/knowledge-base/",
  "AJAX_MODE" => "N",
  "AJAX_OPTION_JUMP" => "N",
  "AJAX_OPTION_STYLE" => "Y",
  "AJAX_OPTION_HISTORY" => "N",
  "CACHE_TYPE" => "N",
  "CACHE_TIME" => "36000000",
  "CACHE_FILTER" => "N",
  "CACHE_GROUPS" => "Y",
  "SET_TITLE" => "N",
  "SET_STATUS_404" => "Y",
  "INCLUDE_IBLOCK_INTO_CHAIN" => "N",
  "ADD_SECTIONS_CHAIN" => "Y",
  "USE_PERMISSIONS" => "N",
  "PREVIEW_TRUNCATE_LEN" => "",
  "LIST_ACTIVE_DATE_FORMAT" => "j F Y",
  "LIST_FIELD_CODE" => array(
    0 => "",
    1 => "",
  ),
  "LIST_PROPERTY_CODE" => array(
    0 => "",
    1 => "",
  ),
  "HIDE_LINK_WHEN_NO_DETAIL" => "N",
  "DISPLAY_NAME" => "Y",
  "META_KEYWORDS" => "-",
  "META_DESCRIPTION" => "-",
  "BROWSER_TITLE" => "-",
  "DETAIL_ACTIVE_DATE_FORMAT" => "j F Y",
  "DETAIL_FIELD_CODE" => array(
    0 => "",
    1 => "",
  ),
  "DETAIL_PROPERTY_CODE" => array(
    0 => "",
    1 => "",
  ),
  "DETAIL_DISPLAY_TOP_PAGER" => "N",
  "DETAIL_DISPLAY_BOTTOM_PAGER" => "N",
  "DETAIL_PAGER_TITLE" => "Страница",
  "DETAIL_PAGER_TEMPLATE" => "",
  "DETAIL_PAGER_SHOW_ALL" => "Y",
  "DISPLAY_TOP_PAGER" => "N",
  "DISPLAY_BOTTOM_PAGER" => "Y",
  "PAGER_TITLE" => "Новости",
  "PAGER_SHOW_ALWAYS" => "N",
  "PAGER_TEMPLATE" => "",
  "PAGER_DESC_NUMBERING" => "N",
  "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
  "PAGER_SHOW_ALL" => "N",
  "DISPLAY_DATE" => "Y",
  "DISPLAY_PICTURE" => "Y",
  "DISPLAY_PREVIEW_TEXT" => "Y",
  "USE_SHARE" => "N",
  "AJAX_OPTION_ADDITIONAL" => "",
  "SEF_URL_TEMPLATES" => array(
    "news" => "",
    "section" => "#SECTION_CODE#/",
    "detail" => "#SECTION_CODE#/#CODE#/",
  )
  ),
  false
); ?>

edabe088cc6d4661958fdb44b4f6176a.PNG

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Nikolaev, 2017-04-19
@ultimate_ramzes

Did you put the component in code or did you take it out in the editor?
If you try to open it with the code in edit mode and just save it - most likely the rules in urlrewrite were not registered.

A
Andrey Goncharov, 2017-04-19
@agmegadeth

I don’t know if it will help, but here it’s probably necessary like this:
"detail" => "#SECTION_CODE#/#ELEMENT_CODE#/",

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question