Need help buying now? +358 9-424-505-31 +1 888-886-76-81
My Cart

Your Cart is Empty

Need help buying now?
+358 9-424-505-31 +1 888-886-76-81

New Product Outputs: How to Display on Home Page via XML

Output of new products on the home page through XML

In this article we will review how to output a new product on a home page using XML layout in any of Gomage templates. First of all, you should go to CMS > Pages > Home Page and choose Design tab. Then, you should add the following code into ‘Layout Update XML’ field that will allow you add the content blocks to the homepage:

<reference  name="content">


Between ‘reference’ tags you should insert the code into new product blocks:

<block  type="catalog/product_new" name="product_new"  template="catalog/product/list.phtml


The next step is selecting the number of columns. This can be done through the following code which should be added between ‘block’ tags:

<action  method="setColumnCount"><column_count>6</column_count></action>


Then, you should set the number of products that will be displayed in the new products block:

<action  method="setProductsCount"><count>0</count></action>


The complete XML layout will look like this:

<reference  name="content">
    <block  type="catalog/product_new" name="product_new"  template="catalog/product/list
        <action  method="setColumnCount"><column_count>6</column_count></action>
        <action  method="setProductsCount"><count>0</count></action>


If it is necessary to display products of a certain category you should add the following code:

<action  method="setCategoryId"><category_id>10</category_id></action>


Here, it is important to make sure that correct category ID is set. You can verify the ID in your admin panel at Catalog > Manage Categories.

Please follow our updates and you will learn other possibilities of Magento ® stores optimizations in the articles in our blog.