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">
<arguments>
<argument name="section" xsi:type="string">productpage</argument>
<argument name="position" xsi:type="number">1</argument>
</arguments>
</block>
<referenceBlock name="catalog.product.related" after="taschert.list.test"
template="Taschert_Example::product/list/items.phtml">
<arguments>
<argument name="type" xsi:type="string">related</argument>
<argument name="section" xsi:type="string">productpage</argument>
<argument name="position" xsi:type="number">1</argument>
</arguments>
</referenceBlock>
</referenceContainer>
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.
Explore related questions
See similar questions with these tags.