2

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.

bumped to the homepage by Community yesterday

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

0

You can use that code with default catalog_product_view.xml

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

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.

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

Just flush the cache

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.