cancel
Showing results for 
Search instead for 
Did you mean: 

layout update for product detail page based on category

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

layout update for product detail page based on category

I am using a product slider from mageplaza to display similar products from category. I have added the code using XML

<referenceContainer name="content">
            <block class="Mageplaza\Productslider\Block\CategoryId" name="product.slider.categoryid" template="productslider.phtml" after="-">
                <arguments>
                    <argument name="products_count" xsi:type="number">5</argument>
                    <argument name="margin" xsi:type="string">5</argument>
                    <argument name="heading" xsi:type="string">You'll love these</argument>
                    <argument name="category_id" xsi:type="number">2</argument>
                    <argument name="description" xsi:type="string">Here is your new products   description </argument>
                </arguments>
            </block>
        </referenceContainer>

 

 

So <argument name="category_id" xsi:type="number">2</argument> has default category ID and i added it under the XMl layout catalog_product_view.xml

 

I have 3 categories. I need to be able to add 3 specific xml like this, can any one help?