Documentation

landing.landing.removeEntities

landing.landing.removeEntities(lid, data)

The method deletes the landing page binded entities - blocks and block images.

Attention: when deleting blocks, the images associated with them are deleted in any case. However, a situation can occur, when images must be deleted independently from a block during cleanup. In such cases, use this method.

Parameters

Parameters Description Available from version
lid Landing page ID
data Associative array, where the blocks key contains blocks for deletion and the images key contains block-image pairs in which the images must be deleted (blocks are not deleted in this case).

Example

BX24.callMethod(
   'landing.landing.removeEntities',
   {
      lid: 648,
      data: {
         blocks: [12167, 123],
         images: [
            {
               block: 12269,
               image: 6866
            },
            {
               block: 12268,
               image: 6861
            }
         ]
      }
   },
   function(result)
   {
      if(result.error())
      {
         console.error(result.error());
      }
      else
      {
         console.info(result.data());
      }
   }
);
// Example demonstrates deleting of blocks with ID 12167, 123, as well as an image 6866 (from the block 12269) and the image 6861 (from block 12268). 
// All entities are located in the landing page 648.


© «Bitrix24», 2001-2024
Up