Magento 2 – Position of Custom Attribute on Product Page

attributesmagento2product

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>

Best Answer

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>