how to use different template file for category magento 2












1















I want to customize the design of catalog list page. ** I want to use different layout and design for each product category**. for that, I am calling different phtml files from static block. using static block I am calling another phtml file but still in product list page default Magento list.phtml files are load. i don't know what actually issue please help me!
I am using Magento 2.1.1 version










share|improve this question





























    1















    I want to customize the design of catalog list page. ** I want to use different layout and design for each product category**. for that, I am calling different phtml files from static block. using static block I am calling another phtml file but still in product list page default Magento list.phtml files are load. i don't know what actually issue please help me!
    I am using Magento 2.1.1 version










    share|improve this question



























      1












      1








      1








      I want to customize the design of catalog list page. ** I want to use different layout and design for each product category**. for that, I am calling different phtml files from static block. using static block I am calling another phtml file but still in product list page default Magento list.phtml files are load. i don't know what actually issue please help me!
      I am using Magento 2.1.1 version










      share|improve this question
















      I want to customize the design of catalog list page. ** I want to use different layout and design for each product category**. for that, I am calling different phtml files from static block. using static block I am calling another phtml file but still in product list page default Magento list.phtml files are load. i don't know what actually issue please help me!
      I am using Magento 2.1.1 version







      magento2






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 7 '18 at 6:50









      Teja Bhagavan Kollepara

      2,94841847




      2,94841847










      asked Oct 11 '16 at 14:31









      Navin BhudiyaNavin Bhudiya

      746924




      746924






















          3 Answers
          3






          active

          oldest

          votes


















          4














          You need to create a xml file catalog_category_view_id_{{id}}.xml under your theme > Magento_Catalog > layout and change list file.



          For detail :
          http://sumankc.com/2016/12/10/different-template-for-different-categories-in-magento-2-category_id-layout-handle-in-m2/






          share|improve this answer
























          • hi Bhudiya, Could you please how you achieved ? I want to create different templates for different category top menu

            – Sushivam
            Feb 21 '17 at 6:37



















          0














          I'm unable to add a comment so I'm going to post an answer.



          catalog_catalog_view.xml has a block with the product list template in there. If you didn't remove it from that xml file, then it will always display in all the other product category.



          Is the list.phtml suppose to only load on certain pages?



          If so, then in admin > products > categories > you product category, under design, you can add the below code to update the layout and have the list.phtml removed from that category page.



          <block name="category.products.list" remove="true"/>


          Let me know if this is what you were looking to do.






          share|improve this answer































            0














            Created customlist.phtml from list.phtml or copied the code of list.phtml and create



            Assign customlist.phtml in admin side (admin → category → Layout section)



            <referenceContainer name="content">
            <referenceBlock name="category.products">
            <block name="product_list" class="MagentoCatalogBlockProductListProduct">
            <action method="setTemplate">
            <argument name="template" xsi:type="string">Magento_Catalog::product/customlist.phtml</argument>
            </action>
            </block>
            </referenceBlock>
            </referenceContainer>




            share























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "479"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f140312%2fhow-to-use-different-template-file-for-category-magento-2%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              4














              You need to create a xml file catalog_category_view_id_{{id}}.xml under your theme > Magento_Catalog > layout and change list file.



              For detail :
              http://sumankc.com/2016/12/10/different-template-for-different-categories-in-magento-2-category_id-layout-handle-in-m2/






              share|improve this answer
























              • hi Bhudiya, Could you please how you achieved ? I want to create different templates for different category top menu

                – Sushivam
                Feb 21 '17 at 6:37
















              4














              You need to create a xml file catalog_category_view_id_{{id}}.xml under your theme > Magento_Catalog > layout and change list file.



              For detail :
              http://sumankc.com/2016/12/10/different-template-for-different-categories-in-magento-2-category_id-layout-handle-in-m2/






              share|improve this answer
























              • hi Bhudiya, Could you please how you achieved ? I want to create different templates for different category top menu

                – Sushivam
                Feb 21 '17 at 6:37














              4












              4








              4







              You need to create a xml file catalog_category_view_id_{{id}}.xml under your theme > Magento_Catalog > layout and change list file.



              For detail :
              http://sumankc.com/2016/12/10/different-template-for-different-categories-in-magento-2-category_id-layout-handle-in-m2/






              share|improve this answer













              You need to create a xml file catalog_category_view_id_{{id}}.xml under your theme > Magento_Catalog > layout and change list file.



              For detail :
              http://sumankc.com/2016/12/10/different-template-for-different-categories-in-magento-2-category_id-layout-handle-in-m2/







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Dec 10 '16 at 18:17









              Suman K.CSuman K.C

              779627




              779627













              • hi Bhudiya, Could you please how you achieved ? I want to create different templates for different category top menu

                – Sushivam
                Feb 21 '17 at 6:37



















              • hi Bhudiya, Could you please how you achieved ? I want to create different templates for different category top menu

                – Sushivam
                Feb 21 '17 at 6:37

















              hi Bhudiya, Could you please how you achieved ? I want to create different templates for different category top menu

              – Sushivam
              Feb 21 '17 at 6:37





              hi Bhudiya, Could you please how you achieved ? I want to create different templates for different category top menu

              – Sushivam
              Feb 21 '17 at 6:37













              0














              I'm unable to add a comment so I'm going to post an answer.



              catalog_catalog_view.xml has a block with the product list template in there. If you didn't remove it from that xml file, then it will always display in all the other product category.



              Is the list.phtml suppose to only load on certain pages?



              If so, then in admin > products > categories > you product category, under design, you can add the below code to update the layout and have the list.phtml removed from that category page.



              <block name="category.products.list" remove="true"/>


              Let me know if this is what you were looking to do.






              share|improve this answer




























                0














                I'm unable to add a comment so I'm going to post an answer.



                catalog_catalog_view.xml has a block with the product list template in there. If you didn't remove it from that xml file, then it will always display in all the other product category.



                Is the list.phtml suppose to only load on certain pages?



                If so, then in admin > products > categories > you product category, under design, you can add the below code to update the layout and have the list.phtml removed from that category page.



                <block name="category.products.list" remove="true"/>


                Let me know if this is what you were looking to do.






                share|improve this answer


























                  0












                  0








                  0







                  I'm unable to add a comment so I'm going to post an answer.



                  catalog_catalog_view.xml has a block with the product list template in there. If you didn't remove it from that xml file, then it will always display in all the other product category.



                  Is the list.phtml suppose to only load on certain pages?



                  If so, then in admin > products > categories > you product category, under design, you can add the below code to update the layout and have the list.phtml removed from that category page.



                  <block name="category.products.list" remove="true"/>


                  Let me know if this is what you were looking to do.






                  share|improve this answer













                  I'm unable to add a comment so I'm going to post an answer.



                  catalog_catalog_view.xml has a block with the product list template in there. If you didn't remove it from that xml file, then it will always display in all the other product category.



                  Is the list.phtml suppose to only load on certain pages?



                  If so, then in admin > products > categories > you product category, under design, you can add the below code to update the layout and have the list.phtml removed from that category page.



                  <block name="category.products.list" remove="true"/>


                  Let me know if this is what you were looking to do.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 12 '16 at 21:15









                  Amy LingAmy Ling

                  90313




                  90313























                      0














                      Created customlist.phtml from list.phtml or copied the code of list.phtml and create



                      Assign customlist.phtml in admin side (admin → category → Layout section)



                      <referenceContainer name="content">
                      <referenceBlock name="category.products">
                      <block name="product_list" class="MagentoCatalogBlockProductListProduct">
                      <action method="setTemplate">
                      <argument name="template" xsi:type="string">Magento_Catalog::product/customlist.phtml</argument>
                      </action>
                      </block>
                      </referenceBlock>
                      </referenceContainer>




                      share




























                        0














                        Created customlist.phtml from list.phtml or copied the code of list.phtml and create



                        Assign customlist.phtml in admin side (admin → category → Layout section)



                        <referenceContainer name="content">
                        <referenceBlock name="category.products">
                        <block name="product_list" class="MagentoCatalogBlockProductListProduct">
                        <action method="setTemplate">
                        <argument name="template" xsi:type="string">Magento_Catalog::product/customlist.phtml</argument>
                        </action>
                        </block>
                        </referenceBlock>
                        </referenceContainer>




                        share


























                          0












                          0








                          0







                          Created customlist.phtml from list.phtml or copied the code of list.phtml and create



                          Assign customlist.phtml in admin side (admin → category → Layout section)



                          <referenceContainer name="content">
                          <referenceBlock name="category.products">
                          <block name="product_list" class="MagentoCatalogBlockProductListProduct">
                          <action method="setTemplate">
                          <argument name="template" xsi:type="string">Magento_Catalog::product/customlist.phtml</argument>
                          </action>
                          </block>
                          </referenceBlock>
                          </referenceContainer>




                          share













                          Created customlist.phtml from list.phtml or copied the code of list.phtml and create



                          Assign customlist.phtml in admin side (admin → category → Layout section)



                          <referenceContainer name="content">
                          <referenceBlock name="category.products">
                          <block name="product_list" class="MagentoCatalogBlockProductListProduct">
                          <action method="setTemplate">
                          <argument name="template" xsi:type="string">Magento_Catalog::product/customlist.phtml</argument>
                          </action>
                          </block>
                          </referenceBlock>
                          </referenceContainer>





                          share











                          share


                          share










                          answered 6 mins ago









                          Rohit GoelRohit Goel

                          20819




                          20819






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Magento Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f140312%2fhow-to-use-different-template-file-for-category-magento-2%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              What other Star Trek series did the main TNG cast show up in?

                              Berlina muro

                              Berlina aerponto