Clone the card of landing.block.clonecard
We are still updating this page
Some data may be missing here — we will complete it shortly.
Scope:
landingWho can execute the method: any user
The method landing.block.clonecard clones a block card. It returns true or an error.
Parameters
|
Method |
Description |
Available since |
|
lid |
Page identifier |
|
|
block |
Block identifier |
|
|
selector |
Card selector taken from the manifest, with the card identifier added. |
Warning
Please note that once you have cloned the card, their counters have changed.
Examples
try
{
const response = await $b24.callMethod(
'landing.block.cloneCard',
{
lid: 311,
block: 6057,
selector: '.landing-block-card@0'
}
);
const result = response.getData().result;
console.info(result);
}
catch(error)
{
console.error(error);
}
try {
$response = $b24Service
->core
->call(
'landing.block.cloneCard',
[
'lid' => 311,
'block' => 6057,
'selector' => '.landing-block-card@0',
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
// Your required data processing logic
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error cloning landing block card: ' . $e->getMessage();
}
BX24.callMethod(
'landing.block.cloneCard',
{
lid: 311,
block: 6057,
selector: '.landing-block-card@0'
},
function(result)
{
if(result.error())
{
console.error(result.error());
}
else
{
console.info(result.data());
}
}
);
How to Use Examples in Documentation
See also
landing.block.addcard - This method fully replicates the functionality of landing.block.clonecard but allows you to insert a card immediately with modified content.