We want to make a menu in the sidebar, based on our attributes inside one magento web shop.

The example would be "Shop by" on this link: http://demo.magentocommerce.com/catalog/category/view/s/shirts/id/4/

We have created new attributes-sidebar.phtml and added following code inside local.xml

<reference name="left">
    <block type="core/template" name="attributes.sidebar" template="callouts/attributes-     sidebar.phtml"/>

We are now trying inside that sidebar-attributes.phtml show the attributes with following code:


 echo "blablablablabla";
    $_helper = Mage::helper('catalog/category');
    $_product = Mage::registry('current_product');

<?php if($_product->getPrice()): ?>
<p>Attribute: <?php echo $_helper->productAttribute($_product, $_product->getPrice(), 'price') ?></p>
<?php else: ?>
<p>No Attribute text here!</p>
<?php endif; ?>

And we are getting nothing.. No errors, nor anything displayed.

Local xml is under:/app/design/frontend/default/our_theme/layout/

And attributes-sidebar.phtml is under: /app/design/frontend/default/our_theme/template/callouts/

  • And on which page should this menu be displayed? Commented Feb 13, 2013 at 19:31
  • On a category page. So left sidebar on a category page.. Commented Feb 13, 2013 at 20:15
  • Are you sure that 'catalog_product_view' handle is loaded in layout on a category page? Because I am pretty sure it isn't and therefore your layout xml is never loaded. Commented Feb 14, 2013 at 11:07

2 Answers 2


The helper should be catalog/output. Apart from that it's looking good. It's still weird you're not seeing anything (not even the blabla part?). You should be seeing a big fat undefined method error.

Check Magento log for missing template errors and make sure you've got all the paths and strings right. You may want to enable developer mode and display_errors.

  • Now we can are seeing blablabla, also change helper to catalog/output, and now below blabla part error shows up: blablablablabla Fatal error: Call to a member function getPrice() on a non-object in/home/kiwikiwi/public_html/metalhouse/app/design/frontend/default/blank_seo/template/callouts/attributes-sidebar.phtml on line 8 Commented Feb 15, 2013 at 20:32

You are doing it wrong in wrong way, as the link you have provided is the category page you need to use catalog_category_view instead of catalog_product_view.

catalog_product_view block is used for product page not for category page. If still the problem exists move your block from local.xml to the catalog.xml of your theme and yes this block will appear on the main section not on the sidebar unless you use left or right block inside catalog_category_view. and your template of category page should be 2colums-right or 2columns-left.

Try this hope you got it.

Happy coding, Sarvagya

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.