• DONATE to NULLED!
    Форуму и его команде можно помочь, мотивировать модераторов разделов.
    Помогите модератору этого раздела wpt лично.

Помощь bitrix.news нет детального просмотра!

Статус
В этой теме нельзя размещать новые ответы.

bitmain

Создатель
Регистрация
7 Фев 2018
Сообщения
12
Реакции
11
Дорогие друзья, то не так? при попытки попасть по ссылке элемента который в корне инфоблока лежит, выдает ошибку: Извините, но запрашиваемая Вами страница не найдена. Попробуйте воспользоваться другими разделами нашего сайта...

файл индекс: /public/blog/index.php

Код:
<?$APPLICATION->IncludeComponent("bitrix:news", ".default", array(
    "IBLOCK_TYPE" => "public", // прописал
    "IBLOCK_ID" => "13", // прописал
    "NEWS_COUNT" => "5",
    "USE_SEARCH" => "N",
    "USE_RSS" => "N",
    "NUM_NEWS" => "20",
    "NUM_DAYS" => "30",
    "YANDEX" => "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" => "Y",
    "SEF_MODE" => "Y",
    "SEF_FOLDER" => "/public/blog/", // прописал
    "AJAX_MODE" => "N",
    "AJAX_OPTION_SHADOW" => "N",
    "AJAX_OPTION_JUMP" => "Y",
    "AJAX_OPTION_STYLE" => "Y",
    "AJAX_OPTION_HISTORY" => "Y",
    "CACHE_TYPE" => "A",
    "CACHE_TIME" => "36000000",
    "CACHE_FILTER" => "N",
    "CACHE_GROUPS" => "Y",
    "DISPLAY_PANEL" => "N",
    "SET_TITLE" => "Y",
    "SET_STATUS_404" => "Y",
    "INCLUDE_IBLOCK_INTO_CHAIN" => "Y",
    "ADD_SECTIONS_CHAIN" => "Y",
    "USE_PERMISSIONS" => "N",
    "PREVIEW_TRUNCATE_LEN" => "",
    "LINK_ELEMENTS_URL" => "link.php?PARENT_ELEMENT_ID=#ELEMENT_ID#", // добавил
    "LIST_ACTIVE_DATE_FORMAT" => "d.m.Y",
    "LIST_FIELD_CODE" => array(
        0 => "",
        1 => "",
    ),
    "LIST_PROPERTY_CODE" => array(
        0 => "",
        1 => "",
    ),
    "HIDE_LINK_WHEN_NO_DETAIL" => "Y",
    "DISPLAY_NAME" => "Y",
    "META_KEYWORDS" => "-",
    "META_DESCRIPTION" => "-",
    "BROWSER_TITLE" => "-",
    "DETAIL_ACTIVE_DATE_FORMAT" => "d.m.Y",
    "DETAIL_FIELD_CODE" => array(
        0 => "",
        1 => "",
    ),
    "DETAIL_PROPERTY_CODE" => array(
        0 => "",
        1 => "",
    ),
    "DETAIL_DISPLAY_TOP_PAGER" => "N",
    "DETAIL_DISPLAY_BOTTOM_PAGER" => "Y",
    "DETAIL_PAGER_TITLE" => "Блог",
    "DETAIL_PAGER_TEMPLATE" => "arrows",
    "DETAIL_PAGER_SHOW_ALL" => "N",
    "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" => "36000000",
    "PAGER_SHOW_ALL" => "N",
    "AJAX_OPTION_ADDITIONAL" => "",
    "SEF_URL_TEMPLATES" => array(
        "news" => "",
        "section" => "",
        "detail" => "#ELEMENT_CODE#/", // прописал
        "search" => "search/",
        "rss" => "rss/",
        "rss_section" => "#SECTION_ID#/rss/",
    )
    ),
    false
);?>

или такой вариант одно и тоже

Код:
<?$APPLICATION->IncludeComponent(
    "bitrix:news",
    "",
    Array(
        "SEF_MODE" => "Y",
        "SEF_FOLDER" => "/public/blog/",
        "SEF_URL_TEMPLATES" => Array(
            "section" => "",
            "detail" => "#ELEMENT_CODE#/",
        ),
        "VARIABLE_ALIASES" => Array(
            "sections_top"=>array(),
            "section"=>array(),
            "detail"=>array("ELEMENT_CODE"=>"IMG"),
        ),
//Common parameters
        "IBLOCK_TYPE" => "public",
        "IBLOCK_ID" => "13",
        "DISPLAY_PANEL" => "N",
        "SET_TITLE" => "Y",
        "CACHE_TIME" => "0",
        "CACHE_FILTER" => "N",
        "FILTER_NAME" => "arrFilter",
        "ELEMENT_SORT_FIELD" => "RATING",
        "ELEMENT_SORT_ORDER" => "desc",
//Sections top specific
        "SECTION_SORT_FIELD" => "sort",
        "SECTION_SORT_ORDER" => "asc",
        "SECTION_COUNT" => "20",
        "TOP_ELEMENT_COUNT" => "9",
        "TOP_LINE_ELEMENT_COUNT" => "3",
//Section specific
        "SECTION_PAGE_ELEMENT_COUNT" => "4",
        "SECTION_LINE_ELEMENT_COUNT" => "2",
//Detail specific
    )
);?>



Создан инфоблок, в списке выводит список эелементов, ссылки вида: /public/blog/how-to-become-a-designer/


но зайти на детальный просмотр не могу, что не так?

шаблоны скопированы с копонента в шаблок коректно:
news
news.list
news.detail
 
Дорогие друзья, то не так? при попытки попасть по ссылке элемента который в корне инфоблока лежит, выдает ошибку: Извините, но запрашиваемая Вами страница не найдена. Попробуйте воспользоваться другими разделами нашего сайта...

файл индекс: /public/blog/index.php

Код:
<?$APPLICATION->IncludeComponent("bitrix:news", ".default", array(
    "IBLOCK_TYPE" => "public", // прописал
    "IBLOCK_ID" => "13", // прописал
    "NEWS_COUNT" => "5",
    "USE_SEARCH" => "N",
    "USE_RSS" => "N",
    "NUM_NEWS" => "20",
    "NUM_DAYS" => "30",
    "YANDEX" => "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" => "Y",
    "SEF_MODE" => "Y",
    "SEF_FOLDER" => "/public/blog/", // прописал
    "AJAX_MODE" => "N",
    "AJAX_OPTION_SHADOW" => "N",
    "AJAX_OPTION_JUMP" => "Y",
    "AJAX_OPTION_STYLE" => "Y",
    "AJAX_OPTION_HISTORY" => "Y",
    "CACHE_TYPE" => "A",
    "CACHE_TIME" => "36000000",
    "CACHE_FILTER" => "N",
    "CACHE_GROUPS" => "Y",
    "DISPLAY_PANEL" => "N",
    "SET_TITLE" => "Y",
    "SET_STATUS_404" => "Y",
    "INCLUDE_IBLOCK_INTO_CHAIN" => "Y",
    "ADD_SECTIONS_CHAIN" => "Y",
    "USE_PERMISSIONS" => "N",
    "PREVIEW_TRUNCATE_LEN" => "",
    "LINK_ELEMENTS_URL" => "link.php?PARENT_ELEMENT_ID=#ELEMENT_ID#", // добавил
    "LIST_ACTIVE_DATE_FORMAT" => "d.m.Y",
    "LIST_FIELD_CODE" => array(
        0 => "",
        1 => "",
    ),
    "LIST_PROPERTY_CODE" => array(
        0 => "",
        1 => "",
    ),
    "HIDE_LINK_WHEN_NO_DETAIL" => "Y",
    "DISPLAY_NAME" => "Y",
    "META_KEYWORDS" => "-",
    "META_DESCRIPTION" => "-",
    "BROWSER_TITLE" => "-",
    "DETAIL_ACTIVE_DATE_FORMAT" => "d.m.Y",
    "DETAIL_FIELD_CODE" => array(
        0 => "",
        1 => "",
    ),
    "DETAIL_PROPERTY_CODE" => array(
        0 => "",
        1 => "",
    ),
    "DETAIL_DISPLAY_TOP_PAGER" => "N",
    "DETAIL_DISPLAY_BOTTOM_PAGER" => "Y",
    "DETAIL_PAGER_TITLE" => "Блог",
    "DETAIL_PAGER_TEMPLATE" => "arrows",
    "DETAIL_PAGER_SHOW_ALL" => "N",
    "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" => "36000000",
    "PAGER_SHOW_ALL" => "N",
    "AJAX_OPTION_ADDITIONAL" => "",
    "SEF_URL_TEMPLATES" => array(
        "news" => "",
        "section" => "",
        "detail" => "#ELEMENT_CODE#/", // прописал
        "search" => "search/",
        "rss" => "rss/",
        "rss_section" => "#SECTION_ID#/rss/",
    )
    ),
    false
);?>

или такой вариант одно и тоже

Код:
<?$APPLICATION->IncludeComponent(
    "bitrix:news",
    "",
    Array(
        "SEF_MODE" => "Y",
        "SEF_FOLDER" => "/public/blog/",
        "SEF_URL_TEMPLATES" => Array(
            "section" => "",
            "detail" => "#ELEMENT_CODE#/",
        ),
        "VARIABLE_ALIASES" => Array(
            "sections_top"=>array(),
            "section"=>array(),
            "detail"=>array("ELEMENT_CODE"=>"IMG"),
        ),
//Common parameters
        "IBLOCK_TYPE" => "public",
        "IBLOCK_ID" => "13",
        "DISPLAY_PANEL" => "N",
        "SET_TITLE" => "Y",
        "CACHE_TIME" => "0",
        "CACHE_FILTER" => "N",
        "FILTER_NAME" => "arrFilter",
        "ELEMENT_SORT_FIELD" => "RATING",
        "ELEMENT_SORT_ORDER" => "desc",
//Sections top specific
        "SECTION_SORT_FIELD" => "sort",
        "SECTION_SORT_ORDER" => "asc",
        "SECTION_COUNT" => "20",
        "TOP_ELEMENT_COUNT" => "9",
        "TOP_LINE_ELEMENT_COUNT" => "3",
//Section specific
        "SECTION_PAGE_ELEMENT_COUNT" => "4",
        "SECTION_LINE_ELEMENT_COUNT" => "2",
//Detail specific
    )
);?>



Создан инфоблок, в списке выводит список эелементов, ссылки вида: /public/blog/how-to-become-a-designer/


но зайти на детальный просмотр не могу, что не так?

шаблоны скопированы с копонента в шаблок коректно:
news
news.list
news.detail
Я ещё зелёный но мне кажется, что

PHP:
"bitrix:news",
"news.detail",
 
Но в каком файле это добавлять, ведь у меня же уже добавлен для вывода списка, или ниже?

дописал в файл index.php:

Код:
<?$APPLICATION->IncludeComponent(
   "bitrix:news.detail",
   "",
   Array(
     "SEF_MODE" => "Y",
     "SEF_FOLDER" => "/public/blog/",
     "SEF_URL_TEMPLATES" => Array(
       "section" => "",
       "detail" => "#ELEMENT_CODE#/",
     ),
     "VARIABLE_ALIASES" => Array(
       "sections_top"=>array(),
       "section"=>array(),
       "detail"=>array("ELEMENT_CODE"=>"IMG"),
     ),
//Common parameters
     "IBLOCK_TYPE" => "public",
     "IBLOCK_ID" => "13",
     "DISPLAY_PANEL" => "N",
     "SET_TITLE" => "Y",
     "CACHE_TIME" => "0",
     "CACHE_FILTER" => "N",
     "FILTER_NAME" => "arrFilter",
     "ELEMENT_SORT_FIELD" => "RATING",
     "ELEMENT_SORT_ORDER" => "desc",
//Sections top specific
     "SECTION_SORT_FIELD" => "sort",
     "SECTION_SORT_ORDER" => "asc",
     "SECTION_COUNT" => "20",
     "TOP_ELEMENT_COUNT" => "9",
     "TOP_LINE_ELEMENT_COUNT" => "3",
//Section specific
     "SECTION_PAGE_ELEMENT_COUNT" => "4",
     "SECTION_LINE_ELEMENT_COUNT" => "2",
//Detail specific
   )
);?>

вывода ноль! почтил кэш, переиндексировал!
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху