I can append my block to content block, by using reference, with this layout update:
<layout version="0.1.0">
<catalog_category_view>
<reference name="content">
<block type="mynamespace_mymodule/myblock" name="filtereduseditems" before="-">
<action method ="getUsedItemsInCategory">
</action>
</block>
<block type="mynamespace_mymodule/myblock" name="filterednewitems" after="-">
<action method ="getNewItemsInCategory">
</action>
</block>
<block type="mynamespace_mymodule/myblock" name="filteredremainderitems" after="-">
<action method ="getRemainderItemsInCategory">
</action>
</block>
</reference>
</catalog_category_view>
</layout>
But it displays before view.phtml. I want it to be displayed after view.phtml, which already exists. How can I do that? I tried these references:
<reference name="category.products">
<reference name="product_list">
<reference name="product_list.name.after">
<reference name="product_list.after">
and it didn't work, the block can only be displayed on:
<reference name="content">
. What else can I try? I want my block (3 instances of it) appended to the end of (name=)'content' block, after view.phtml, or appended to view.phtml, but without changing the view.phtml.
2 Answers 2
If you are using product_list then write this code in your catalog/product/list.phtml file
<?php echo $this->getChildHtml('filtereduseditems'); ?>
And If you are using category.products then add above code in catalog/layer/view.phtml file
-
Thanks. This is one way to do it. I want to do it completely with xml updates, without changing the list.phtml and view.phtml files.The Outstanding Question Asker– The Outstanding Question Asker2016年11月25日 14:08:25 +00:00Commented Nov 25, 2016 at 14:08
-
@VladimirDespotovic you can use
product_list.afterreference name but it will add your block after the product listing, otherwise there is no default block in list page for your problem2016年11月25日 14:16:15 +00:00Commented Nov 25, 2016 at 14:16 -
@VladimirDespotovic if you want directly via xml then your refreance block should be type with ` block type="core/text_list" `2016年11月25日 14:19:02 +00:00Commented Nov 25, 2016 at 14:19
-
It doesn't even work on core/text_list. I tried to put it on: product_list.name.after and it doesn't work.The Outstanding Question Asker– The Outstanding Question Asker2016年11月25日 14:40:46 +00:00Commented Nov 25, 2016 at 14:40
-
are you using color swatches ?2016年11月25日 16:47:02 +00:00Commented Nov 25, 2016 at 16:47
You can try with footer_before reference
<layout version="0.1.0">
<catalog_category_view>
<reference name="footer_before">
<block type="mynamespace_mymodule/myblock" name="filtereduseditems">
<action method="getUsedItemsInCategory">
</action>
</block>
<block type="mynamespace_mymodule/myblock" name="filterednewitems">
<action method="getNewItemsInCategory">
</action>
</block>
<block type="mynamespace_mymodule/myblock" name="filteredremainderitems">
<action method="getRemainderItemsInCategory">
</action>
</block>
</reference>
</catalog_category_view>
</layout>