Get Content of Block landing.block.getcontent

We are still updating this page

Some data may be missing — we will fill it in shortly

Scope: landing

Who can execute the method: any user

The method landing.block.getcontent retrieves the content of a block. It returns an array of block content - html, style files, and JS. Or an error.

Parameters

Method

Description

Available from

lid
unknown

Page identifier

block
unknown

Block identifier

editMode
unknown

Editing mode (1) or not (0), will return a different set of blocks

params
unknown

Array of additional parameters. Currently supports one key – wrapper_show – whether to show the enclosing system div (0, 1). Default - show.

Examples

try
        {
        	const response = await $b24.callMethod(
        		'landing.block.getContent',
        		{
        			lid: 4858,
        			block: 39556,
        			editMode: 1,
        			params: {
        				wrapper_show: 0
        			}
        		}
        	);
        	
        	const result = response.getData().result;
        	console.info(result);
        }
        catch(error)
        {
        	console.error(error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'landing.block.getContent',
                    [
                        'lid'      => 4858,
                        'block'    => 39556,
                        'editMode' => 1,
                        'params'   => [
                            'wrapper_show' => 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 getting landing block content: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'landing.block.getContent',
            {
                lid: 4858,
                block: 39556,
                editMode: 1,
                params: {
                    wrapper_show: 0
                }
            },
            function(result)
            {
                if(result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.info(result.data());
                }
            }
        );
        

How to Use Examples in Documentation