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

Passing arguments to blocks
 
stevensurowiec
Jr. Member
 
Total Posts:  15
Joined:  2008-06-23
 

I recently setup a block to pull the children of a category and display them a certain way on the home page. This is working great but I’m going to need to do the same thing for three more categories, each one displayed slightly differently. The existing code is:

<block type="catalog/category_list" name="home.catalog.category.list" alias="category_list" template="catalog/category/list.phtml" />
What I was hoping to be able to do is something like this:
<block type="catalog/category_list" name="home.catalog.category.list" alias="category_list" template="catalog/category/list.phtml" parent="3" />
Where ‘parent’ gets passed to the List.php file. The syntax here isn’t as important as just being able to do it, since this would save me from having to copy and paste existing functionality for a single one-line change and would make it easier for the client in the future.

Any help is appreciated.

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