Change the content of the block landing.block.updatenodes
We are still updating this page
Some data may be missing — we will fill it in shortly
Scope:
landingWho can execute the method: any user
The method landing.block.updatenodes changes the content of the block. It returns true or an error. This method is also used for updating the parameters of dynamic blocks, such as the product list, detailed product, and some others.
Parameters
|
Method |
Description |
Version |
|
lid |
Page identifier |
|
|
block |
Block identifier |
|
|
data |
Array of selectors and new values. |
Examples
BX24.callMethod(
'landing.block.updatenodes',
{
lid: 311,
block: 6058,
data: {
'.landing-block-node-text': 'Text with html',
'.landing-block-node-img': {src: '/some/path/picture.png', alt: 'My picture'},
'.landing-block-node-link': {text: 'My link', href: 'https://bitrix24.com', target: '_blank'},
'.landing-block-node-icon': ['fa-telegram', 'fa-skype'],
'.landing-block-node-embed': {src: '//www.youtube.com/embed/q4d8g9Dn3ww?autoplay=1&controls=0&loop=1&mute=1&rel=0', source: 'https://www.youtube.com/watch?v=q4d8g9Dn3ww'},
},
},
function(result)
{
if(result.error())
{
console.error(result.error());
}
else
{
console.info(result.data());
}
}
);
How to Use Examples in Documentation
Editing parameters of dynamic blocks
There are several dynamic blocks whose parameters can be changed via REST. For example, the number of products on a page. This can be done as follows.
-
Use the method landing.block.getmanifest to find out what parameters the block has. The method will return an array of the manifest, where we are interested in the key
attrsand the parameters of the dynamic block component you are interested in. In this case, we are interested inbitrix:catalog.section.attrs: bitrix:catalog.section: Array(24) 0: {name: "Section ID", style: false, original_type: "component", component_type: "STRING", attribute: "SECTION_ID", …} 1: {name: "Unavailable products", style: false, original_type: "component", component_type: "LIST", attribute: "HIDE_NOT_AVAILABLE", …} 2: {name: "Unavailable trade offers", style: false, original_type: "component", component_type: "LIST", attribute: "HIDE_NOT_AVAILABLE_OFFERS", …} 3: {name: "Field by which we sort elements", style: false, original_type: "component", component_type: "LIST", attribute: "ELEMENT_SORT_FIELD", …} 4: {name: "Order of sorting elements", style: false, original_type: "component", component_type: "LIST", attribute: "ELEMENT_SORT_ORDER", …} 5: {name: "Currency to which prices will be converted", style: false, original_type: "component", component_type: "LIST", attribute: "CURRENCY_ID", …} 6: {name: "Price type", style: false, original_type: "component", component_type: "LIST", attribute: "PRICE_CODE", …} ... -
Use the method
landing.block.updatenodesto change the necessary parameters. Historically, dynamic parameters (attributes) are changed specifically through this method.JSBX24.callMethod( 'landing.block.updatenodes', { lid: 5597, block: 44131, data: { 'bitrix:catalog.section': { attrs: { 'MESS_BTN_BUY': 'Add to my cart' } } }, function(result) { if (result.error()) { console.error(result.error()); } else { console.info(result.data()); } } } );