Documentation

landing.landing.favoriteBlock

Scope: landing Permissions to execute: for all

landing.landing.favoriteBlock(
    lid,
    block,
    meta
)

Method saves block available at the "My blocks" page. Returns new saved block ID.

Note: Method can be useful when deleting saved block.

Parameters

Method Description Available from version
lidPage ID.
blockBlock ID.
metaInformation object for saved block. Contains fields:
  • name – block name;
  • section – array categories to save the block;
  • preview – block image.

Example

BX24.callMethod(
    'landing.landing.favoriteBlock',
    {
        lid: 11262,
        block: 81827,
        meta: {
           name: 'My block',
           section: ['text', 'text_image'],
           preview: 'https://mycdn.com/pic/1.jpg'
        }
    },
    function(result)
    {
        if(result.error())
        {
            console.error(result.error());
        }
        else
        {
            console.info(result.data());
        }
    }
);


© «Bitrix24», 2001-2024