Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Category Products in CMS Pages
 
seoguy
Member
 
Total Posts:  46
Joined:  2008-01-25
 

Hi all,

Up until this latest release, I was using the following code to display category products on the cms pages:

{{block type="catalog/product_list" category_id="PLACE THE CORESPONDING CATEGORY NUMBER HERE"}}

With this latest release, it no longer works.

Any ideas what the code should be now?

Thanks

Chris

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michae1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 

Hi Chris,

The code is almost the same, you just have to specify the template it should use:

{{block type="catalog/product_list" category_id="your_category_id" template="catalog/product/list.phtml"}}
 
Magento Community Magento Community
Magento Community
Magento Community
 
seoguy
Member
 
Total Posts:  46
Joined:  2008-01-25
 

Hey Michael,

It did the trick thanks!!!!

Chris

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dave Smith
Member
 
Avatar
Total Posts:  58
Joined:  2008-02-03
Tamworth, UK
 

Sorry to hijack but I suspect this is similar to a problem I am experiencing. Please see attached images. I have latest Magento installed with all sample data. Product lists are not display products and the product pages are blank. Any help greatly appreciated.

Image Attachments
product_list.jpgproduct.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
harry12bar
Sr. Member
 
Avatar
Total Posts:  168
Joined:  2008-01-07
 

Hi, working ok for me with latest version 0.8.17240.

 
Magento Community Magento Community
Magento Community
Magento Community
 
itchytrig
Sr. Member
 
Avatar
Total Posts:  162
Joined:  2008-10-03
UK
 

@Michael

Just to let you know, although an old post, still very applicable today.

This quick fix has just allowed us to setup even better CMS landing pages!

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
eliezerisrael
Jr. Member
 
Total Posts:  28
Joined:  2009-06-18
 

Any idea how to do this for a tag page? 
It seems that the tagId is parsed in the controller…

 
Magento Community Magento Community
Magento Community
Magento Community
 
itchytrig
Sr. Member
 
Avatar
Total Posts:  162
Joined:  2008-10-03
UK
 

Hi,

Taking this one stage further, has anyone figured out how to add just a single product, say a spot product to a CMS page, with an include too?

I could start adding product images, price, spec, link etc all by hand, but this defeats the whole point.

Thanks in advance

 
Magento Community Magento Community
Magento Community
Magento Community
 
itchytrig
Sr. Member
 
Avatar
Total Posts:  162
Joined:  2008-10-03
UK
 

An old topic, but another question based on this…

Adding the above block works for adding sections results to CMS pages, great. But is there a block available that will allow a list of search results to be listed, within a CMS page too?

The block would simply contain the search term you want to list products for?

Would help us if anyone has figured this out?

Thanks again !

 
Magento Community Magento Community
Magento Community
Magento Community
 
CastleknockBohs
Jr. Member
 
Total Posts:  6
Joined:  2010-02-11
 

Hi,
similar to this, does anyone know how to have a single product’s view being displayed rather than the category?

 
Magento Community Magento Community
Magento Community
Magento Community
 
itchytrig
Sr. Member
 
Avatar
Total Posts:  162
Joined:  2008-10-03
UK
 

One way,

1 - Create another section, but don’t list it with your others…
2 - Add 1 product to it
3 - add the block to your cms page, as mentioned above.

sorted.

 
Magento Community Magento Community
Magento Community
Magento Community
 
CastleknockBohs
Jr. Member
 
Total Posts:  6
Joined:  2010-02-11
 
itchytrig - 23 February 2010 12:40 AM

One way,

1 - Create another section, but don’t list it with your others…
2 - Add 1 product to it
3 - add the block to your cms page, as mentioned above.

sorted.

Thanks. Would this not just display a category listing though and just feature one product? I want the product view page (the default one, with the images, description, add to cart button etc) for a single item.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paul Whipp
Member
 
Total Posts:  48
Joined:  2009-03-23
 

It is somewhat ironic, given Magento’s propensity for creating small blocks that the code to display a single product with its details is actually hardcoded into the list template (in version 1.4.01 at least). You will find it in the catalog/product/list.phtml template.

If you copy the code inside the ‘foreach’ statement there into a template of your own, you can reference it directly as a block in your own CMS page anywhere you like.

I’d recommend using the same block in your theme’s version of the list.phtml too for consistency.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cleverhomes
Jr. Member
 
Total Posts:  15
Joined:  2009-03-13
 

Can anyone tell me how to automatically include the selected category’s name and description at the top of the page? I think that information is in view.phtml rather than list.phtml.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kearney
Jr. Member
 
Total Posts:  8
Joined:  2010-03-26
 

I am trying to include the products of two categories on a cms page. I tried the following code - {{block type=\"catalog/product_list\" category_id=\"1345\" template=\"catalog/product/list2.phtml\"}} - which works perfectly. But the problem that I am having when I repeat this block twice - {{block type=\"catalog/product_list\" category_id=\"1345\" template=\"catalog/product/list.phtml\"}} {{block type=\"catalog/product_list\" category_id=\"32\" template=\"catalog/product/list.phtml\"}} - because I would like two categories to appear one after another. But it just repeats the first category, so that the first category appears twice.

any ideas, any help would be greatly appreciated.

thanks in advance.

Paul

 
Magento Community Magento Community
Magento Community
Magento Community
 
kamilborkowski
Member
 
Avatar
Total Posts:  54
Joined:  2010-02-01
 

To show products from few categories on any CMS page you can use this free extension: JRD_Listcategories
and in editor you can just write {{block type="JRD_Listcategories/product_listcategories" categories="3,11,12,4,7,5,6,13,8,10,14,1823,19,20,21,22" template="catalog/product/list.phtml"}}.
Each page will also have own cache.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2