« Go back to Template Functions


Returns a custom block, previously created within the XML files of your particular Magento theme.

This block could be the default topnav, sidebar cart, custom cart, category listing, bespoke navigation; literally any block created through Magento using the standard XML method.


<?php the_block($name); ?>
  • $name: this is the name of the block you are looking to display.


When making a block in Magento, you will most likely create a PHTML file, and reference that file in one of the many XML files. The XML reference will look similar to to this:

<block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>

Take note of the following: name=”catalog.topnav”.

/* Display a block - the top navigation */


You can use the above method to display any block from Magento.

Related Functions