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?

  • 1
    show code?...... – Amit Bera Feb 11 '15 at 11:07
  • sorry must have been a copy and paste error – Klettseb Feb 11 '15 at 11:12
  • Change name bestsellers.sidebar to bestsellers.catsidebar.Please show all category.xml code – Amit Bera Feb 11 '15 at 11:26
  • I´m confused, why would the name change help so much? – Klettseb Feb 11 '15 at 12:13
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>
  • thats what I´m doing but nothing is showing up. There is no error, nothing. Maybe the path needs to be relative or anything – Klettseb Feb 11 '15 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 Feb 11 '15 at 12:15
  • 1
    this also won´t work. I will try my best and see if I can get it fixed – Klettseb Feb 11 '15 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, privacy policy and cookie policy

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