Get the list of page blocks landing.block.getlist

We are still updating this page

Some data may be missing — we will complete it shortly.

Scope: landing

Who can execute the method: any user

The method landing.block.getlist retrieves a list of page blocks. It returns an array of blocks or an error.

Parameters

Method

Description

Version

lid
unknown

Identifier of the page, or an array of identifiers.

params
unknown

Parameters:

  • edit_mode - Editing mode (1) or not (0 - default), will return a different set of blocks. Note that if you have not published the page, nothing will be returned in mode 0.
  • deleted - deleted (1) or not (0) blocks, by default all non-deleted blocks are displayed. In edit_mode=0, there cannot be any deleted blocks.

Examples

try {
            $response = $b24Service
                ->core
                ->call(
                    'landing.block.getlist',
                    [
                        'lid' => 313,
                        'params' => [
                            'edit_mode' => 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 block list: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'landing.block.getlist',
            {
                lid: 313,
                params: {
                    edit_mode: 0
                }
            },
            function(result)
            {
                if(result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.info(result.data());
                }
            }
        );
        

How to Use Examples in Documentation