Bitrix API

Block

Table of Contents

Methods

addCard()  : PublicActionResult
Add card in block by selector.
changeAnchor()  : PublicActionResult
Set new anchor to the block.
changeNodeName()  : PublicActionResult
Change node name.
cloneCard()  : PublicActionResult
Clone card in block by selector.
getAssetsConfig()  : PublicActionResult
Get extensions configs, load relations, load lang phrases
getById()  : PublicActionResult
Get one block of landing.
getContent()  : PublicActionResult
Get content as is from Block.
getContentFromRepository()  : PublicActionResult
Get content of block from repository.
getFileDisk()  : PublicActionResult
Returns disk's file by attached object id.
getList()  : PublicActionResult
Get available blocks of landing.
getManifest()  : PublicActionResult
Get available blocks of landing.
getManifestFile()  : PublicActionResult
Get manifest array as is from block.
getRepository()  : mixed
Get blocks from repository.
publication()  : PublicActionResult
Publication one block from landing.
removeCard()  : PublicActionResult
Remove card from block by selector.
updateAttrs()  : PublicActionResult
Update attributes in block by selector.
updateCards()  : PublicActionResult
Change cards multiple.
updateContent()  : PublicActionResult
Update content in the Block.
updateNodes()  : PublicActionResult
Update nodes in block by selector.
updateStyles()  : PublicActionResult
Update classes in block by selector.
uploadFile()  : PublicActionResult
Upload file by url or from FILE.

Methods

addCard()

Add card in block by selector.

public static addCard(int $lid, int $block, string $selector, string $content[, bool $preventHistory = false ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$selector : string

Selector.

$content : string

Content of card.

$preventHistory : bool = false

True if no need save history

Return values
PublicActionResult

changeAnchor()

Set new anchor to the block.

public static changeAnchor(int $lid, int $block, string $data[, bool $preventHistory = false ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$data : string

New anchor.

$preventHistory : bool = false

True if no need save history

Return values
PublicActionResult

changeNodeName()

Change node name.

public static changeNodeName(int $lid, int $block, array<string|int, mixed> $data[, bool $preventHistory = false ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$data : array<string|int, mixed>

Array with selector and value.

$preventHistory : bool = false

True if no need save history

Return values
PublicActionResult

cloneCard()

Clone card in block by selector.

public static cloneCard(int $lid, int $block, string $selector[, bool $preventHistory = false ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$selector : string

Selector.

$preventHistory : bool = false

True if no need save history

Return values
PublicActionResult

getAssetsConfig()

Get extensions configs, load relations, load lang phrases

public static getAssetsConfig(array<string|int, mixed> $extCodes[, array<string|int, mixed> $tplCodes = [] ]) : PublicActionResult
Parameters
$extCodes : array<string|int, mixed>
  • array of extensions codes
$tplCodes : array<string|int, mixed> = []
  • array of site templates
Return values
PublicActionResult
  • array of assets by type

getById()

Get one block of landing.

public static getById(int $block[, array<string|int, mixed> $params = array() ]) : PublicActionResult
Parameters
$block : int

Block id.

$params : array<string|int, mixed> = array()

Some params.

Return values
PublicActionResult

getContent()

Get content as is from Block.

public static getContent(int $lid, int $block[, bool $editMode = false ][, array<string|int, mixed> $params = array() ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$editMode : bool = false

Edit mode if true.

$params : array<string|int, mixed> = array()

Some params.

Return values
PublicActionResult

getContentFromRepository()

Get content of block from repository.

public static getContentFromRepository(string $code) : PublicActionResult
Parameters
$code : string

Block code.

Return values
PublicActionResult

getFileDisk()

Returns disk's file by attached object id.

public static getFileDisk(int $fileId) : PublicActionResult
Parameters
$fileId : int

File (attached object) id.

Return values
PublicActionResult

getList()

Get available blocks of landing.

public static getList(int $lid[, array<string|int, mixed> $params = array() ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$params : array<string|int, mixed> = array()

Some params.

Return values
PublicActionResult

getManifest()

Get available blocks of landing.

public static getManifest(int $lid, int $block[, array<string|int, mixed> $params = array() ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$params : array<string|int, mixed> = array()

Some params.

Return values
PublicActionResult

getManifestFile()

Get manifest array as is from block.

public static getManifestFile(string $code) : PublicActionResult
Parameters
$code : string

Code name, format "namespace:code".

Return values
PublicActionResult

getRepository()

Get blocks from repository.

public static getRepository([string $section = null ]) : mixed
Parameters
$section : string = null

Section code.

publication()

Publication one block from landing.

public static publication(int $block) : PublicActionResult
Parameters
$block : int

Block id.

Return values
PublicActionResult

removeCard()

Remove card from block by selector.

public static removeCard(int $lid, int $block, string $selector[, bool $preventHistory = false ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$selector : string

Selector.

$preventHistory : bool = false

True if no need save history

Return values
PublicActionResult

updateAttrs()

Update attributes in block by selector.

public static updateAttrs(int $lid, int $block, array<string|int, mixed> $data) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$data : array<string|int, mixed>

Array with selector and data.

Return values
PublicActionResult

updateCards()

Change cards multiple.

public static updateCards(int $lid, int $block, array<string|int, mixed> $data) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$data : array<string|int, mixed>

Array with cards.

Return values
PublicActionResult

updateContent()

Update content in the Block.

public static updateContent(int $lid, int $block, string $content[, bool $designed = false ][, bool $preventHistory = false ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$content : string

Block content.

$designed : bool = false

Block was designed.

$preventHistory : bool = false

True if no need save history

Return values
PublicActionResult

updateNodes()

Update nodes in block by selector.

public static updateNodes(int $lid, int $block, array<string|int, mixed> $data[, array<string|int, mixed> $additional = array() ][, bool $preventHistory = false ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$data : array<string|int, mixed>

Array with selector and value.

$additional : array<string|int, mixed> = array()

Additional prams for save.

$preventHistory : bool = false

True if no need save history

Return values
PublicActionResult

updateStyles()

Update classes in block by selector.

public static updateStyles(int $lid, int $block, array<string|int, mixed> $data[, bool $preventHistory = false ]) : PublicActionResult
Parameters
$lid : int

Landing id.

$block : int

Block id.

$data : array<string|int, mixed>

Array with selector and data.

$preventHistory : bool = false

True if no need save history

Return values
PublicActionResult

uploadFile()

Upload file by url or from FILE.

public static uploadFile(int $block, mixed $picture[, string $ext = false ][, array<string|int, mixed> $params = [] ][, bool $temp = false ]) : PublicActionResult
Parameters
$block : int

Block id.

$picture : mixed

File url / file array.

$ext : string = false

File extension.

$params : array<string|int, mixed> = []

Some file params.

$temp : bool = false

This is temporary file.

Return values
PublicActionResult

        
On this page

Search results