S
S
SouLFiX2017-07-02 14:34:48
CMS
SouLFiX, 2017-07-02 14:34:48

How to display infoblock sections and a list of elements inside?

You should get a structure of three levels:
website/shops/shop sections/list of elements inside the section
in the admin panel, it looks like this:
SN3w0Bl.jpg
In the shops there will be sections with tiles, by clicking on the section - a list of elements (regular pictures), everything is simple.
I have tried using various components to do this. With the help of news and catalog in various combinations. There are problems either with CNC and nesting, or with the bulkiness of the components. The closest was the catalog component. But it's too big for such a simple thing, I haven't been able to get all the extra stuff out of it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pashted, 2017-07-02
@SouLFiX

infoblock sections: https://dev.1c-bitrix.ru/api_help/iblock/classes/c...
list of elements: https://dev.1c-bitrix.ru/api_help/iblock/classes/c...

D
DM, 2020-03-16
@neverenn

An example of displaying a list of infoblock sections by ID.
Instead of SECTION_ID, you can use the infoblock ID, i.e. IBLOCK_ID or subsection ID of the infoblock section.

<ul id="liva">
      <?$filter_7 = array('SECTION_ID'=>"34", 'ACTIVE'=>'Y');
      $db_list_id7 = CIBlockSection::GetList(array(), $filter_7, true, Array("UF_DATE"));
      while ($arSect = $db_list_id7->GetNext()){
      $arSect["photo"] = CFile::GetPath($arSect["PICTURE"]);
      ?>

      <li id="liver">
        <a href="/<?=$arSect["CODE"]?>">
          <?=$arSect["NAME"]?>
        </a>
      </li>

      <? } ?>
    </ul>

Nesting depends on what you specify here:
<?$filter_7 = array('SECTION_ID'=>"34", 'ACTIVE'=>'Y');

If this is an infoblock, then the entire hierarchy of categories and sections will appear.
If this is an infoblock category, then the entire hierarchy of sections will be shown, and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question