Answer the question
In order to leave comments, you need to log in
How to get infoblock element properties (Bitrix)?
There is a custom slider. It outputs an image. But I need to display more properties of this slide (title, description). I created properties for the infoblock, but I can't figure out how to display it.
When I do a dump there are no properties.
template.php
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
?>
<div class="production-slider-wrapper">
<ul class="production-slider">
<?foreach ($arResult as $item): ?>
<?
$file = CFile::ResizeImageGet($item["PREVIEW_PICTURE"], array('width' => 1200,'height' => 600), BX_RESIZE_IMAGE_EXACT, true);
?>
<li class="production-slide">
<div class="production-figure">
<img class="production-slide__image" src="<?= $file['src'] ?>" alt="">
</div>
<div class="production-slide-text">
<? print_r($item)?>
<h3 class="production-slide__title"><?= $item['TITLE']?></h3>
<p class="production-slide__description"><?= $item['DESCRIPTION']?></p>
</div>
</li>
<?endforeach;?>
</ul>
</div>
Array ( [ID] => 2154 [~ID] => 2154 [NAME] => Слайдер 1 [~NAME] => Слайдер 1 [PREVIEW_PICTURE] => 9539 [~PREVIEW_PICTURE] => 9539 [DETAIL_PAGE_URL] => /slider/detail.php?ID=2154 [~DETAIL_PAGE_URL] => /slider/detail.php?ID=2154 [LANG_DIR] => / [~LANG_DIR] => / [CODE] => [~CODE] => [EXTERNAL_ID] => 2154 [~EXTERNAL_ID] => 2154 [IBLOCK_SECTION_ID] => [~IBLOCK_SECTION_ID] => [IBLOCK_TYPE_ID] => slider [~IBLOCK_TYPE_ID] => slider [IBLOCK_ID] => 27 [~IBLOCK_ID] => 27 [IBLOCK_CODE] => [~IBLOCK_CODE] => [IBLOCK_EXTERNAL_ID] => [~IBLOCK_EXTERNAL_ID] => [LID] => s1 [~LID] => s1 )
Answer the question
In order to leave comments, you need to log in
navToggle.addEventListener('click', function() {
if (navMain.classList.contains('main-nav--closed')) {
navMain.classList.remove('main-nav--closed');
navMain.classList.add('main-nav--opened');
} else {
navMain.classList.add('main-nav--closed');
navMain.classList.remove('main-nav--opened');
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question