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: landing

Who 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
unknown

Page identifier

block
unknown

Block identifier

data
unknown

An array of selectors and new values. See the example for more details. A selector can be passed without specifying a position (for example, .landing-block-node-text), in which case all cards for that selector will be changed. It can also be passed with a position specified (for example, .landing-block-node-text@2), in which case only the card at the specified position (zero-based) will be changed.

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