Magento Forum

   
How do I Q: display a category in front page
 
balam
Jr. Member
 
Total Posts:  4
Joined:  2008-08-05
 

Hi
I want to display a category in the front page.

thanks in advance

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lol
Member
 
Avatar
Total Posts:  68
Joined:  2008-06-26
Plymouth, UK
 

@balam: Try this:

Copy the following line into the Content field of your Home Page edit window;

{{block type="catalog/product_list" category_id="id_of_your_required_category" template="catalog/product/list.phtml"}}

That’s it! Just make sure you use the correct category ID (a number) and you should be in business. To get the necessary category ID just go to the Categories admin screen and select the category with the products you want displayed. Once the edit category screen appears, check the URL for that page and you should see something like this:

.../your_store/index.php/admin/catalog_category/edit/id/10/

In this case it’s the number 10 that you would use for the category ID.

Hope that helps. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
balam
Jr. Member
 
Total Posts:  4
Joined:  2008-08-05
 

thank you Lol it works

 
Magento Community Magento Community
Magento Community
Magento Community
 
AngelEyes
Member
 
Total Posts:  74
Joined:  2008-02-25
 

Is it me or 1.1.4 the ID no longer shows in the URI?

Anyone another simple way to find the category number?

Thanks,

Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

Mage::registry('current_category')

That will only work on pages that have a category set in the URL (won’t necessarily need the category ID in the URL)

If you need it in the code, I believe this will work:

Mage::registry('current_category')->getId();

 
Magento Community Magento Community
Magento Community
Magento Community
 
Azim
Sr. Member
 
Total Posts:  97
Joined:  2008-09-17
NY, USA
 

@ Lol, i used the code in my home page and it did show the category’s products i selected. But if i want to display newly added products on the main page no matter which category they belong to, how would i do that?
And i want to display the category box on the left and the products in the center and the other boxes on the left side(wishlist, my cart etc.)
Any idea how to do this much.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
polis
Jr. Member
 
Total Posts:  3
Joined:  2008-09-17
 

Try to build your category list from default category and you will have success wink

Use this guide:
http://www.magentocommerce.com/wiki/welcome_to_the_magento_user_s_guide/chapter_3/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top