Add Pagination In Product Listings

I have noticed on a number of Magento websites that I have been designing, don’t include the pagination or pager links within the category listings. To remedy this oversight, simply update catalog.xml to include call to pager.phtml file wiht the following code:

<block type=”page/html_pager” name=”product_list_toolbar_pager”/>

You will want to locate the reference to the Product List Toolbar and updated to match the following:

<block type=”catalog/product_list_toolbar” name=”product_list_toolbar” template=”catalog/product/list/toolbar.phtml”>
<block type=”page/html_pager” name=”product_list_toolbar_pager”/>

Just place the pager reference inside the Product List Toolbar and you are set. Rememeber to refresh your cache before trying to view the live changes.

Insert a Custom Block into Magento Template File

As apposed to creating / adding a block to one of your Magento theme files, working directly in one of the template or .phtml files is a better way to call a static block.

In continuing to develop and learn Magento I have made a number of discoveries that help clarify how to work within the setup of Magento. In most cases when looking to customize a given page, I was directed to making updates to the Layout .xml files.

However if I was looking to simply add a static block to a specific section of a template file, creating a static block to the appropriate .xml file would simply add the static block above or below a given area.

The following code for example, would add the contact_intro above my contact form, but in the setup of that page, I wanted the contact_intro to integrate into a specific section of the fonrm.phtml template. This was not possible by updating the contacts.xml file as follows:

<reference name=”content”>
<block type=”cms/block” name=”contact_intro”>
<action method=”setBlockId”><block_id>contact_intro</block_id></action>
<block type=”core/template” name=”contactForm” template=”contacts/form.phtml”/>

Instead I needed to update the form.phtml file directly. Where I could place the contact_intro directly into the setup of the contacts page html:

<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘contact_intro’)->toHtml() ?>

Now I do not have two seperate blocks, when trying to add a block to the layout file. I have placed the static block exactly where I want it to be called within the contacts page.

I hope this helps clear things up as it has for me when trying to accomplish certain Magento layout updates.

Remove Sidebar Callouts in Magento Layout

Here are a coupe of quick references for removing sidebar callouts in either a template/layout .xml file or custom page Layout per page. I used the following to remove some unwanted blocks from the homepage sidebar by updating the XML Layout for the homepage under the Design tab, such as the cart which is unnecessary on a website homepage.

<reference name=”right”>
<action method=”unsetChild”><name>cart_sidebar</name></action>
<action method=”unsetChild”><name></name></action>
<action method=”unsetChild”><name>right.reports.product.viewed</name></action>
<action method=”unsetChild”><name>right.permanent.callout</name></action>