Answer the question
In order to leave comments, you need to log in
How to display the symbolic code of a component in Bitrix?
Hello. I have a bitrix.catalog component. There is also bitrix.catalog.section
I'm trying to display a symbolic code. He gives me the name normally $arSection["NAME"]
I do var_dump($arSection) and I have the line ["CODE"] => string(12)blabla
But when I do var_dump($arSection["CODE"]) writes NULL . Inexplicably.
Answer the question
In order to leave comments, you need to log in
Because in result_modifier.php you have written
and in template.php you output
in template.php you need to output then like this
<?foreach($arResult["~ITEMS"] as $key=>$arSection1):?>
<?foreach($arSection1 as $key=>$arSection):?>
<div class="cont <?=$arSection["CODE"]?>">
<div class="flaty">
<p><?=$arSection["NAME"]?></p>
</div>
<img class="shadow" src="/i/shadow.png" alt="">
</div>
<?endforeach?>
<?endforeach?>
<? $arResult["~ITEMS"][$key] = $arItem;?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question