1

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

3

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

9
  • 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. Nov 25, 2016 at 14:08
  • @VladimirDespotovic you can use product_list.after reference name but it will add your block after the product listing, otherwise there is no default block in list page for your problem 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" ` 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. Nov 25, 2016 at 14:40
  • are you using color swatches ? Nov 25, 2016 at 16:47
0

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> 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.