Есть два инфоблока, и в одной из них в детальной новости я вывожу связанные элементы с другого инфоблока, но выводятся все, а мне надо чтобы не выводились не активные, как это сделать?
<ul class="capabilities-schedule__modules">
<?$programCourseItemCounter = 1;?>
<?foreach ($arResult['PROGRAM_COURSE_ITEMS'] as $keyProgramCourseItem => $arProgramCourseItem):?>
<li class="capabilities-schedule__module">
<input class="capabilities-schedule__switch-input" type="checkbox" id="capabilities-schedule__switch-input-<?=$programCourseItemCounter?>" wfd-invisible="true">
<label class="capabilities-schedule__module-title" for="capabilities-schedule__switch-input-<?=$programCourseItemCounter?>">
<p class="capabilities-schedule__module-num"><?=$programCourseItemCounter?> модуль</p>
<span class="capabilities-schedule__module-name"><?=$arProgramCourseItem['NAME']?></span>
</label>
<div class="capabilities-schedule__collapsed-content">
<div class="capabilities-schedule__timetable">
<div class="capabilities-schedule__months capabilities-schedule__months--short"><?=$arProgramCourseItem['MODULE_TIME']?></div>
<ul class="capabilities-schedule__months capabilities-schedule__months--full">
<?foreach ($arProgramCourseItem['SCHEDULE_ITEMS']['MONTH'] as $month => $items):?>
<li class="capabilities-schedule__month">
<div class="capabilities-schedule__month-name"><?=$arResult['MONTHS'][$month]?></div>
<ul class="capabilities-schedule__days">
<?foreach ($items as $item):?>
<li class="capabilities-schedule__day">
<?if ($item['START_DATE']['DAY'] && $item['START_DATE']['MONTH']):?>
<span class="capabilities-schedule__date">
<span class="capabilities-schedule__date-day"><?=$item['START_DATE']['DAY']?></span>
<span class="capabilities-schedule__date-divider">/</span>
<span class="capabilities-schedule__date-month"><?=$item['START_DATE']['MONTH']?></span>
</span>
<?endif;?>
<span class="capabilities-schedule__day-text <?if ($item['NAME_ITALICS']):?>capabilities-schedule__day-text--italic<?endif;?>"><?=$item['NAME']?></span>
</li>
<?endforeach;?>
</ul>
</li>
<?endforeach;?>
</ul>
</div>
<?if ($arProgramCourseItem['COMMON_INFO']):?>
<div class="capabilities-schedule__info">
<div class="capabilities-schedule__info-icon"></div>
<ul class="capabilities-schedule__info-list">
<?foreach ($arProgramCourseItem['COMMON_INFO'] as $keyCommonInfoItem => $arCommonInfoItem):?>
<li class="capabilities-schedule__info-item"><?=$arCommonInfoItem['TEXT']?></li>
<?endforeach;?>
</ul>
</div>
<?endif;?>
</div>
</li>
<?$programCourseItemCounter++;?>
<?endforeach;?>
</ul>