Documentation

landing.block.addcard

landing.block.addcard(lid, block, selector, content)

The method works completely the same as landing.block.clonecard but offers an option to insert a card with already modified content.

Parameters

Method Description Available from version
lid Page ID
block Block ID
selector Card selector, taken from manifest with added card ID.
For example: '.landing-block-card@0'. '0' at the end signifies the first card will be affected in sequence.
content Content of new card.

Note: as soon as you cloned a card, both card counters have changed.

Examples

BX24.callMethod(
   'landing.block.addCard',
   {
      lid: 634,
      block: 12079,
      selector: '.landing-block-node-menu-list-item@0',
      content: ''
   },
   function(result)
   {
      if(result.error())
      {
         console.error(result.error());
      }
      else
      {
         console.info(result.data());
      }
   }
);


© «Bitrix24», 2001-2024