how to use different template file for category magento 2
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
add a comment |
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
add a comment |
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
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
magento2
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
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
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/
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
add a comment |
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.
add a comment |
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>
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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/
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
add a comment |
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/
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
add a comment |
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/
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/
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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Oct 12 '16 at 21:15
Amy LingAmy Ling
90313
90313
add a comment |
add a comment |
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>
add a comment |
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>
add a comment |
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>
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>
answered 6 mins ago
Rohit GoelRohit Goel
20819
20819
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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