Documentation

landing.block.updateCards

landing.block.updateCards(lid, block,data)

The method for black block cards update. Returns true on success or an error.

Attention! This method completely deletes the current block cards.

Parameters

Parameter Description
lid Landing page ID.
block Block ID.
data Array to be modified. See example for clarifications. Card presets can be passed optionally.

Example

BX24.callMethod(
   'landing.block.updateCards',
   {
      lid: 2856,
      block: 25458,
      data: {
         //interact with this card selector
         // (other selectors can be passed simultaneously)
         '.landing-block-card': {
            //the number of cards is left that have
            //only the indicated nodes modified;
            //first card is taken to be cloned
            'values': [
               {
                  '.landing-block-node-title': 'New title 0'
               },
               {
                  '.landing-block-node-title': 'New title 1'
               },
               {
                  '.landing-block-node-title': 'New title 2'
               }
            ],
            //card Presets can be applied optionally (key - indexing card number, stating from 0)
            'presets': {
               '1': 'preset_h2'
            }
         }
      }
   },
   function(result)
   {
      if(result.error())
      {
         console.error(result.error());
      }
      else
      {
         console.info(result.data());
      }
   }
);


© «Bitrix24», 2001-2024