I want to add cms block above description, how to do in custom theme?
1 Answer
Add the below code in your catalog_product_view.xml file,
<referenceContainer name="content">
<block class="Magento\Cms\Block\Block" name="demo" before="product.info.details">
<arguments>
<argument name="block_id" xsi:type="string">demo</argument>
</arguments>
</block>
</referenceContainer>
-
I i did, its not applied, i am created cms static block id= "1", identifier= "demo" just put into your script, its not working.– zusCommented Jan 12, 2021 at 11:37
-
instead of "block_identifier" use your block identifier. Commented Jan 12, 2021 at 11:48
-
I am getting following error, 1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'name': [facet 'pattern'] The value 'block identifier' is not accepted by the pattern '[a-zA-Z0-9][a-zA-Z\d-_.]*'. Line: 1195– zusCommented Jan 12, 2021 at 11:54
-
-
<referenceContainer name="content"> <block class="Magento\Cms\Block\Block" name="block identifier" before="product.info.details"> <arguments> <argument name="1" xsi:type="string">demo</argument> </arguments> </block> </referenceContainer>– zusCommented Jan 12, 2021 at 11:56