I
I
IgorRastarov2017-03-28 11:10:01
1C-Bitrix
IgorRastarov, 2017-03-28 11:10:01

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

1 answer(s)
S
Sergey Shaklein, 2017-03-29
@sanshung

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?>

or fix in result_modifier.php
this
on the
<? $arResult["~ITEMS"][$key] = $arItem;?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question