In Magento 2, admin can place blocks in the left or right sidebar of a particular page through updating a layout to the XML code. Besides, admin is able to place the block in sidebar and even control its relative position with other blocks with just a few simple changes in code detail.
Sometimes, we use the term callout to refer to a block which is considered as a layout update with XML code. Also, the sidebar refers to the left or right columns of the page layout. When you enter layout update code, ensure to follow the syntax exactly as what the example shows.
To Place a Block in the Sidebar of a Page
- Open the admin sidebar and choose Content. Next, click on Blocks under Elements.
- Take a look at the grid to find the block you want to position and carefully take note its identifier. Check the spelling to make sure that there is no spelling mistake.
- On the Admin sidebar, click on Content. Next, under Elements, choose Pages.
- Determine the page where you want to place the block and open it in edit mode.
- In the board on the left, click on Design. Next, do the following:
a. In the Layout Update SML area, enter the code for determining the right or the left sidebar.
Code for CMS: Block in Sidebar
b. In Reference Name field, change to identify either the right or left column following the layout of the page.
c. In Block_id field, set up it to the identifier of the block which is being placed.
6. When complete, tap Save Page button in the upper right corner to finish.
Here is all the knowledge of Using Layout Update lesson we want to share. If you find it helpful for you, please Like, Share and Subscribe to keep updating for our coming blogs!