cancel
Showing results for 
Search instead for 
Did you mean: 

Add my cms static block to the right column in product view

SOLVED

Add my cms static block to the right column in product view

Hi, 

 

I'm trying to put my own static cms block to the column of the right in the product view (to all products).

- I create the CMS block identifier="first_block" (i notice that the content editor doesn't works in Mozilla)

- And i add this code to:

app/design/frontend/{Package}/{theme}/Magento_Catalog/layout/catalog_product_view.xml

 

<?xml version="1.0"?>
<page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
	<body>
		<!--referenceContainer name="sidebar.additional"-->
		<referenceContainer name="content">
			<referenceBlock name="catalog.compare.sidebar" remove="true"/>
			<block class="Magento\Cms\Block\Block" name="first_block">
				<arguments>
					<argument name="block_id" xsi:type="string">bla</argument>
				</arguments>
			</block>
		</referenceContainer>
	</body>
</page>

I tried to change argument name to first_block too, but nothing change... i can't see the new block.

 

Any idea.

 

Regards

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Add my cms static block to the right column in product view

I have an error in my syntax

		<referenceContainer name="sidebar.additional">
		   <block class="Magento\Cms\Block\Block" name="first_block">
		       <arguments>
		            <argument name="block_id" 
xsi:type="string">first_block</argument> </arguments> </block> </referenceContainer>

View solution in original post

1 REPLY 1

Re: Add my cms static block to the right column in product view

I have an error in my syntax

		<referenceContainer name="sidebar.additional">
		   <block class="Magento\Cms\Block\Block" name="first_block">
		       <arguments>
		            <argument name="block_id" 
xsi:type="string">first_block</argument> </arguments> </block> </referenceContainer>