0

I'm changing the <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml"> template using another handler:

<other_custom_handler>
    <reference name="product_list">
        <action method="setTemplate">
            <template>custom/module/catalog/product/list.phtml</template>
        </action>
    </reference>
    <remove name="advancedmenu.sidenav" />
</other_custom_handler>

other_custom_handler is already a working handler, however, instead of copying catalog/product/list.phtml to custom module template, I want it to be more dynamic using the said method. It's not working.

Update:

Here are the layout handles:

array(7) {
  [0] => string(7) "default"
  [1] => string(8) "cms_page"
  [2] => string(17) "STORE_otherstore_default"
  [3] => string(28) "THEME_frontend_othertheme_default"
  [4] => string(15) "cms_index_index"
  [5] => string(21) "page_two_columns_left"
  [6] => string(19) "customer_logged_out"
}

I created a CMS page that displays all the products using catalog/product_list block. Products are displaying correctly, fyi.

  • what do you mean by "dynamic" ? could you please explain it little bit ? – Rajeev K Tomy May 6 '15 at 1:21
  • I have multiple handlers that need to have different templates, ie., other_custom_handler uses template1.phtml, other_custom_handler_2 uses template2.phtml – user1240207 May 6 '15 at 1:49
0

I can see two possibilities for this non-working-layout-update if you are sure about your custom handler is a proper working handler.

  1. other_custom_handler is not including in the category view page. You handler may be working, but you need to make sure this handler is triggering in category view page.

  2. if other_custom_handler is triggering in category view page, then you should ensure that, this custom handler is used only after catalog_category_default or catalog_category_layered layout handlers are processed. This is because, the block product_list is available only after either of these layout handles are processed, so that you can refer it through your custom layout handles.

Most probably , the second case may be issue.. Take care of these points.

EDIT - 1

So you are adding product_list via CMS Page (through admin). So this will ceases the possibilities for updating the product_list block via any layout-update file, since Magento considers CMS Page custom layout updates after processing all of the above mentioned handlers.

If you want to modify, the product_list block, the only possibility is update it programmatically and it will be difficult to implement though.

  • Ok I got it now. Here's what I did, I created a CMS page that displays all the products (product listing). Since you said catalog_category_default should be triggered, I figured it out that it's not. See my update. – user1240207 May 6 '15 at 2:12
  • okay how did you put the product listing in cms page ? – Rajeev K Tomy May 6 '15 at 2:14
  • Yes, I did put the product listing in the cms and the products are displaying correctly. – user1240207 May 6 '15 at 2:17
  • nope that is not what i asked.. how did you put it ? Means via content section or via custom layout update for cms page ? – Rajeev K Tomy May 6 '15 at 2:17
  • I updated answer. – Rajeev K Tomy May 6 '15 at 2:39

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.