0

I am having problems adding a block to my sidebar in one of my category pages. I am using the Custom Layout Update function to add my bestsellers to one specific category page. The XML file for my bestsellers is created and the code inside is that one

    <reference name="left">
        <block type="bestsellers/view" name="bestsellers.sidebar" before="-" template="bestsellers/view.phtml"/>
    </reference>

and then in the Category I have added this

 <reference name="left">
    <block type="bestsellers/view" name="bestsellers.sidebar" before="-" template="bestsellers/view.phtml"/>
    <remove name="catalog.leftnav"/>
 </reference>

but still it´s nothing showing up there. I am confused why this won´t work. I also thought of adding the block to a static cms block but this won´t work either.

Any suggestions?

4
  • 1
    show code?......
    – Amit Bera
    Commented Feb 11, 2015 at 11:07
  • sorry must have been a copy and paste error
    – seb
    Commented Feb 11, 2015 at 11:12
  • Change name bestsellers.sidebar to bestsellers.catsidebar.Please show all category.xml code
    – Amit Bera
    Commented Feb 11, 2015 at 11:26
  • I´m confused, why would the name change help so much?
    – seb
    Commented Feb 11, 2015 at 12:13

2 Answers 2

1

For particular category , you can manage it from admin too.From Manage Categories > Your Category > Custom Design > Custom Layout Update

<reference name="left">
  <block type="bestsellers/view" name="bestsellers.sidebar" before="-" template="bestsellers/view.phtml"/>
</reference>
3
  • thats what I´m doing but nothing is showing up. There is no error, nothing. Maybe the path needs to be relative or anything
    – seb
    Commented Feb 11, 2015 at 12:08
  • might be this will help <reference name="left"> <block type="bestsellers/view" name="bestsellers.sidebar"> <action method="setTemplate"> <template>bestsellers/view.phtml</template> </action> </block> </reference>
    – Digisha
    Commented Feb 11, 2015 at 12:15
  • 1
    this also won´t work. I will try my best and see if I can get it fixed
    – seb
    Commented Feb 11, 2015 at 12:31
1

This is correct

 <reference name="left">
    <block type="bestsellers/view" name="bestsellers.sidebar" before="-" template="bestsellers/view.phtml"/>
    <remove name="catalog.leftnav"/>
 </reference>

The issue was that I wanted this on my frontpage but it didnt work because the Bestsellers from the root catalog wouldn´t work so after putting it into a category page it worked fine.

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.