Jump to content
  • 0

Вывод новостей с определенным ID


timesoon
 Share

Question

Здравствуйте, на страницу, с помощью компонеты 2.0 "Новости", выводятся новости определеного инфо блока, а как сделать чтоб выводились новости этого инфо блока не все которые в нем присутствуют, а только с указанными ID?

Вот код блока:

<?$APPLICATION->IncludeComponent(
"bitrix:news",
".default",
Array(
"SEF_MODE" => "Y",
"AJAX_MODE" => "N",
"IBLOCK_TYPE" => "vacancies",
"IBLOCK_ID" => "15",
"NEWS_COUNT" => "10",
"USE_SEARCH" => "N",
"USE_RSS" => "N",
"USE_RATING" => "N",
"USE_CATEGORIES" => "N",
"USE_REVIEW" => "N",
"USE_FILTER" => "N",
"SORT_BY1" => "SORT",
"SORT_ORDER1" => "DESC",
"SORT_BY2" => "SORT",
"SORT_ORDER2" => "ASC",
"CHECK_DATES" => "Y",
"PREVIEW_TRUNCATE_LEN" => "",
"LIST_ACTIVE_DATE_FORMAT" => "d.m.Y",
"LIST_FIELD_CODE" => array(),
"LIST_PROPERTY_CODE" => array(),
"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(),
"DETAIL_PROPERTY_CODE" => array(),
"DETAIL_DISPLAY_TOP_PAGER" => "N",
"DETAIL_DISPLAY_BOTTOM_PAGER" => "Y",
"DETAIL_PAGER_TITLE" => "Страница",
"DETAIL_PAGER_TEMPLATE" => "",
"DETAIL_PAGER_SHOW_ALL" => "Y",
"DISPLAY_PANEL" => "N",
"SET_TITLE" => "N",
"SET_STATUS_404" => "N",
"INCLUDE_IBLOCK_INTO_CHAIN" => "N",
"ADD_SECTIONS_CHAIN" => "Y",
"USE_PERMISSIONS" => "N",
"CACHE_TYPE" => "A",
"CACHE_TIME" => "3600",
"CACHE_FILTER" => "N",
"CACHE_GROUPS" => "Y",
"DISPLAY_TOP_PAGER" => "N",
"DISPLAY_BOTTOM_PAGER" => "Y",
"PAGER_TITLE" => "Вакансии",
"PAGER_SHOW_ALWAYS" => "Y",
"PAGER_TEMPLATE" => "",
"PAGER_DESC_NUMBERING" => "N",
"PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
"PAGER_SHOW_ALL" => "Y",
"SEF_FOLDER" => "/about/vacancies/",
"AJAX_OPTION_SHADOW" => "Y",
"AJAX_OPTION_JUMP" => "N",
"AJAX_OPTION_STYLE" => "Y",
"AJAX_OPTION_HISTORY" => "N",
"AJAX_OPTION_ADDITIONAL" => "",
"SEF_URL_TEMPLATES" => Array(
"news" => "",
"section" => "",
"detail" => "#ELEMENT_ID#/",
"search" => "search/",
"rss" => "rss/",
"rss_section" => "#SECTION_ID#/rss/"
),
"VARIABLE_ALIASES" => Array(
"news" => Array(),
"section" => Array(),
"detail" => Array(),
"search" => Array(),
"rss" => Array(),
"rss_section" => Array(),
)
)
);?>

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

1) переходите в режим "правки" - ввреху справа ползунок.

2) скопируйте через меню компонента сам компонент в папку с шаблоном сайта.

3) зайдите в скопированную папку и отредактируйте файл template.php - шаблон компонента, или можно в режиме правки так же через меню компонента.

4) распечатайте массив: <?echo '<pre>'; print_r($arResult); echo '</pre>';?> и смотрите что у вас там за что отвечает.

  • Like 1
Link to comment
Share on other sites

  • 0
3) зайдите в скопированную папку и отредактируйте файл template.php - шаблон компонента, или можно в режиме правки так же через меню компонента.

А что в нем редактировать?

немного пункты перепутал, сначала распечатайте массив, а затем в зависимости от его содержимого отредактируйте так, как вам это нужно.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy