Magento for B2B Commerce

Using a Layout Update

Blocks can be placed in the left or right sidebarThe right or left column of a two-column page layout. of a specific page by making a layout update to the XMLExtensible Markup Language: A markup format derived from SGML that it used to format information for publication and distribution. code. With a few simple changes to the code, you can position the block in either sidebar, and control its position in relation to other blocks.

The term calloutA term that is sometimes used to describe a block that is defined as a layout update using XML code. is sometimes used to refer to a block that is defined as a layout updateA specific set of XML instructions that determines how the page is constructed. with XML code. The term sidebarThe right or left column of a two-column page layout. refers to the left or right columns of the page layoutThe visual and structural composition of a page.. When entering layout update code, make sure to follow the syntax exactly as shown in the example.

To place a block in the sidebar, the page must have a two-or three-column layout. To learn more, see: Page Layout.

To place a block in the sidebar of a page:

1. On the Admin sidebar, tap Content. Then under Elements, choose Blocks.
2. In the grid, find the block you want to place, and take note of its Identifier. Make sure that you have the correct spelling.
3. On the Admin sidebar, tap Content. Then under Elements, choose Pages.
4. Find the page where you want to place the block, and open the page in edit mode.
5. In the panel on the left, choose Design. Then, do the following:
a. In the Layout Update XML box, enter the code for the right or left sidebar.
  • Code for CMS Block in Sidebar
                                        <reference name="right">
    <block type="cms/block" name="right.permanent.callout">
    <action method="setBlockId"><block_id>your-block-id</block_id></action>
    </block>
    </reference>
b. Change the reference name to identify either the “right” or “left” column, according to the layout of the page.
c. Change the block_id to the identifier of the block that is being placed.
6. When complete, tap Save Page.