I'm modifying the layout of the product view.

I'm trying to move and edit the product related block "catalog.product.related".

In my catalog_product_view.xml I have :

 <referenceContainer name="content.aside">
            <block class="Taschert\Example\Block\Product\Test" after="-" name="taschert.list.test" template="Taschert_Example::product/test.phtml">
                    <argument name="section" xsi:type="string">productpage</argument>
                    <argument name="position" xsi:type="number">1</argument>
            <referenceBlock name="catalog.product.related" after="taschert.list.test"
                    <argument name="type" xsi:type="string">related</argument>
                    <argument name="section" xsi:type="string">productpage</argument>
                    <argument name="position" xsi:type="number">1</argument>

The block product related use my custom template but show before my first block. Did I miss something ?

I have tried just to move the block with no result.

<move element="catalog.product.related" destination="content.aside" after="taschert.list.test"/>

I've clear my cache.

3 Answers 3

<move element="catalog.product.related" destination="product.info.main" before="-" />

Just flush the cache


You can use that code with default catalog_product_view.xml

<move element="catalog.product.related" destination="product.info.main" after="product.info.details" />

In your XML you have the tag after="-", this means that this block is called after all the blocks.
Remove this piece of code from the first block, flush cache and check again.

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.