Change the Tag Name of landing.block.changeNodeName
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.changeNodeName changes the tag name. For example, it is required to change the h3 tag to an h1 tag. It will return true on success or an error.
Parameters
|
Method |
Description |
Available since |
|
lid |
Page identifier |
|
|
block |
Block identifier |
|
|
data |
An array of selectors and new values. See the example for more details. A selector can be passed without specifying a position (for example, |
Examples
try
{
const response = await $b24.callMethod(
'landing.block.changeNodeName',
{
lid: 2006,
block: 20476,
data: {
'.landing-block-node-small-title@0': 'i',
'.landing-block-node-small-title@1': 'u'
}
}
);
const result = response.getData().result;
console.info(result);
}
catch( error )
{
console.error(error);
}
try {
$response = $b24Service
->core
->call(
'landing.block.changeNodeName',
[
'lid' => 2006,
'block' => 20476,
'data' => [
'.landing-block-node-small-title@0' => 'i',
'.landing-block-node-small-title@1' => 'u'
]
]
);
$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 changing node name: ' . $e->getMessage();
}
BX24.callMethod(
'landing.block.changeNodeName',
{
lid: 2006,
block: 20476,
data: {
'.landing-block-node-small-title@0': 'i',
'.landing-block-node-small-title@1': 'u'
}
},
function (result)
{
if (result.error())
{
console.error(result.error());
}
else
{
console.info(result.data());
}
}
);
How to Use Examples in Documentation