Charlie Harvey

Magento tip: Set number of new products shown in CMS block

I am currently doing a redesign of the New Internationalist ethical shop’s home page. I just spent about 20 minutes trying to work out how to set the number of products that are displayed in the new products block when it is called from within a CMS page in Magento.

If you’re in the same boat, then you can use this bit of code in your CMS page, changing the column_count and products_count as required. In my case, I also created a custom template for the product list. Replace with your own if you want to do that. {{block type="catalog/product_new" column_count="6" products_count="12" name="home.newproducts" template="catalog/product/list.phtml"}}


Comments

  • Be respectful. You may want to read the comment guidelines before posting.
  • You can use Markdown syntax to format your comments. You can only use level 5 and 6 headings.
  • You can add class="your language" to code blocks to help highlight.js highlight them correctly.

Privacy note: This form will forward your IP address, user agent and referrer to the Akismet, StopForumSpam and Botscout spam filtering services. I don’t log these details. Those services will. I do log everything you type into the form. Full privacy statement.