1

I am calling a block into a category page using the following code:

<reference name="content">
<block type="cms/block" name="my-grid" as="my-grid" before="-">
<action method="setBlockId"><block_id>my-grid</block_id></action>
</block>
</reference>

This calls in a block (which loads a phtml code) and places it at the top of the category page.

How can I move it down, so it is just below the category header title? So essentially, just one line lower in the page > but not sure how to control that.

Thanks!

1

Change your code to

<reference name="content"> <block type="cms/block" name="my-grid" as="my-grid" before="block-name"> <action method="setBlockId"><block_id>my-grid</block_id></action> </block> </reference>

where block-name is the block to be used as reference. Tags before and after applies for this. Some documentation about this here.

| improve this answer | |
  • ok, thanks. By enabling bloock name tips, I can see that its called "Mage_Catalog_Block_Category_View". However, I want my block to be 'in' in that block itself. This block is the category header, followed by the text in the category description field. I want my new block to go between the category header and category description. Sounds like a problem? – egg Jul 16 '14 at 14:57
  • That is not the name you wanted. That is the class of the block instead of the name. The name is in the XML file. Probably he name of the block you are looking for is in catalog.xml since you are looking a category page by the class you saw. – mbalparda Jul 16 '14 at 15:02
  • Hi Folks, I still didn't work this out. I am looking for it to be inserted in the line before the Product Description is pumped out. I've tried using before="product.description" but no go :( – egg Jul 31 '14 at 17:12
  • Check the name of that block and replace product.description for the one you find. – mbalparda Jul 31 '14 at 17:19
  • ok, but I don't get how to check for that block. There are no blocks for those sections. They come from the view.phtml page, there you can see the description being called via:<?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?> etc ... but in the catalog.xml there is nothing. :( – egg Jul 31 '14 at 17:22

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.