Documentation

landing.landing.addblock

Scope: landing Permissions to execute: for all

landing.landing.addblock(lid, fields)

This method adds new block to the landing page. Returns ID of the new block or an error.

Parameters

Method Description Available from version
lid Landing page ID
fields Array of block fields that have only three values at the moment:
  • CODE - symbol code of the block.
    Block code can be obtained from the landing.block.getrepository method. If a block is added that was registered by a partner via landing.repo.register, then it is necessary to pass repo_<ID> value for CODE, where <ID> - is the ID of such block.
  • AFTER_ID - after which block (its ID) a new block must be added (if not specified, block will be added at the beginning)
  • ACTIVE - block activity (Y / N)
  • CONTENT - all other block contents in full (see notes for the method . замечания для метода landing.block.updatecontent)

Example

BX24.callMethod(
	'landing.landing.addblock',
	{
		lid: 351,
		fields: {
			CODE: '15.social'
		}
	},
	function(result)
	{
		if(result.error())
		{
			console.error(result.error());
		}
		else
		{
			console.info(result.data());
		}
	}
);


© «Bitrix24», 2001-2024