4

I would like to display my custom attribute name "teaser" after the short description.

Below in catalog_product_view.xml didn't work.

<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>
   <referenceBlock name="product.info.details">
     <block class="Magento\Catalog\Block\Product\View\Description" name="product.teaser" as="product.teaser" template="product/view/teaser.phtml" after="product.info.overview">
        <argument translate="true" name="title" xsi:type="string">teaser</argument>
        </arguments>             
     </block>
   </referenceBlock>        
 </body>
</page>
2

You have to give referenceContainer"product.info.main" instead of product.info.details

<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="product.info.main">
     <block class="Magento\Catalog\Block\Product\View\Description" name="product.teaser" as="product.teaser" template="product/view/teaser.phtml" after="product.info.overview">
        <argument translate="true" name="title" xsi:type="string">teaser</argument>
        </arguments>             
     </block>
   </referenceContainer>        
 </body>
</page>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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