Skip to content

Instantly share code, notes, and snippets.

@qwersk
Last active March 21, 2017 09:59
Show Gist options
  • Select an option

  • Save qwersk/15378c59c10aba05b464c220eb8e2777 to your computer and use it in GitHub Desktop.

Select an option

Save qwersk/15378c59c10aba05b464c220eb8e2777 to your computer and use it in GitHub Desktop.
GET ELEMENTS FROM MULTIPLE IBLOCKS BITRIX
if(CModule::IncludeModule("iblock"))
{
// выберем 3 элемента типа "cases" из нескольких информационных блоков (16, 17)
$items = GetIBlockElementListEx("cases", array(16, 17), Array(),
Array("DATE_ACTIVE_FROM"=>"DESC", "SORT"=>"ASC", "NAME" => "ASC"), 3);
// постраничная навигация
$items->NavPrint("Новости компании");
// цикл по всем новостям
while($arItem = $items->GetNext())
{
// выведем ссылку на страницу с детальным просмотром
echo "<a href='".$arItem["DETAIL_PAGE_URL"]."'>".$arItem["NAME"]."</a>";
// выведем дату
echo $arItem["DATE_ACTIVE_FROM"]."<br>";
// выведем картинку для анонса, с ссылкой на детальный просмотр
echo ShowImage($arItem["PREVIEW_PICTURE"], 100, 100,
"border='0'", $arItem["DETAIL_PAGE_URL"]);
// выведем анонс
echo $arItem["PREVIEW_TEXT"]."<hr>";
}
$items->NavPrint("Новости компании");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment