I have one block on the page :
<block type="obishomeaddon/customcategory" name="customcategory" template="homeaddon/customcategory.phtml">
<action method="setData"> <name>column_count</name> <value>4</value> </action>
<action method="setData"> <name>category_id</name> <value>213</value> </action>
</block>
Now, I want to have two of these blocks but different category_id. The problem I have is Magento will loop through the XML first, so the last category_id will be set and all the blocks will have the same category_id
Which is a good way to solve this problem?
Aasim Goriya
5,4622 gold badges30 silver badges54 bronze badges
asked Feb 18, 2013 at 13:34
Dzung Nguyen
1651 gold badge1 silver badge5 bronze badges
-
Did you gave your blocks different names?Tim Bezhashvyly– Tim Bezhashvyly2013年02月18日 13:39:11 +00:00Commented Feb 18, 2013 at 13:39
-
yep, different names - different blocksSergey– Sergey2013年02月18日 13:43:57 +00:00Commented Feb 18, 2013 at 13:43
-
thanks you guys. This is a stupid question, I didn't notice the name was the same :)Dzung Nguyen– Dzung Nguyen2013年02月18日 15:06:04 +00:00Commented Feb 18, 2013 at 15:06
-
Posted as an answer.Tim Bezhashvyly– Tim Bezhashvyly2013年02月19日 07:40:47 +00:00Commented Feb 19, 2013 at 7:40
1 Answer 1
Please make sure your blocks have different names.
answered Feb 19, 2013 at 7:39
Tim Bezhashvyly
11.6k6 gold badges44 silver badges73 bronze badges
default