Entity Blocks

We are still updating this page

Some data may be missing — we will complete it soon.

Quick navigation: all methods

A block is HTML code accompanied by a manifest file. Here is an example of a simple block:

<section class="landing-block">
            <div class="text-center g-color-gray-dark-v3 g-pa-10">
                <div class="g-width-600 mx-auto">
                    <div class="landing-block-node-text g-font-size-12 ">
                        <p>&copy; 2017 All rights reserved. Developed by
                        <a href="#" class="landing-block-node-link g-color-primary">Bitrix24</a></p>
                    </div>
                </div>
            </div>
        </section>
        

It is important to remember that when blocks are rendered (both in edit mode and view mode), they are wrapped in a special wrapper <div id="anchor" class="block-wrapper block-code">...</div>, where:

  • anchor – the anchor of the block, if not changed by the user, will be in the format block123, where 123 is the block ID;
  • block-wrapper – a common class for all blocks;
  • block-code – a class that depends on the block code, where code is the actual code of the block (converted to a safe format).

Warning

In edit mode, copies of all blocks are created before they are published. Accessing blocks by ID should refer to the draft versions of the blocks.

You can order the layout of new blocks from a specialist or use the additional blocks offered by the vendor.

Overview of Methods

Method

Description

Available since

landing.block.clonecard

Method for cloning a block card.

landing.block.removecard

Method for removing a block.

landing.block.updatenodes

Method for changing the content of a block.

landing.block.changeNodeName

Method to change the tag name.

landing.block.updateattrs

Method for changing the attributes of a block node.

landing.block.updateStyles

Method for changing the styles of a block.

landing.block.getcontent

Method for retrieving the content of a block.

landing.block.getlist

Method for getting a list of blocks on the page.

landing.block.getbyid

Method for retrieving a block by its identifier.

landing.block.getmanifest

Method for retrieving the manifest of a specific block already placed on the page.

landing.block.getmanifestfile

Method for retrieving the manifest of a block from the repository.

landing.block.getrepository

Method returns a list of blocks from the repository.

landing.block.uploadfile

Method uploads an image and associates it with the specified block.

landing.block.updatecontent

Method updates the content of a block already placed on the page to any arbitrary content.

landing.block.addcard

Method fully replicates the work of landing.block.clonecard but allows inserting a card with modified content immediately.

landing.block.updateCards

Method for bulk updating block cards.

landing.block.changeAnchor

Method changes the symbolic code of the anchor.

landing.block.getContentFromRepository

Method retrieves the content of a block from the repository "as is" before adding the block to any page.

18.7.500