0

I want to add cms block above description, how to do in custom theme?

1 Answer 1

0

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>
7
  • I i did, its not applied, i am created cms static block id= "1", identifier= "demo" just put into your script, its not working.
    – zus
    Commented 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
    – zus
    Commented Jan 12, 2021 at 11:54
  • please share your code.. Commented Jan 12, 2021 at 11:55
  • <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>
    – zus
    Commented Jan 12, 2021 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.