Magento Forum

   
Assigning specific blocks to the homepage? 
 
rzazueta
Member
 
Total Posts:  34
Joined:  2008-07-21
 

I have a custom menu I created that pulls the children from a specific category and show them on the left. This is a special navigational feature that I only want to display on the homepage in the “left” coilumn. The only way I;ve been able to make this work is by putting a reference to left under <default> in catalog.xml. This works fine for displaying that left menu on the homepage, but it also displays it on subsequent pages. On the category pages and such, I want something different in that left hand column.

How do I remove something that’s been specified in the <default> handle? Or, better yet, how to specify something to only show up in the left column on the homepage and not on subsequent pages? putting it in cms.xml didn;t do the trick, by the way, nor did creating a handle block for <cms_index_defaultindex> in catalog.xml.

Thanks!

Rob Z.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

use remove or unsetChild in the subsequent pages.

example of remove: 
<remove name="left.permanent.callout" />

example of unsetChild:
<reference name="left">
<action method="unsetChild"><name>left.permanent.callout</name></action>
</reference>

I quite believe you only need to unset/remove it in three files:

1) customer.xml
2) checkout.xml
3) catalog.xml

Alternatively, declare that custom menu directly in the homepage: Use one-column layout template, then create a custom 2 (or 3) columns layout in the content area - not ethis only work if you don’t want any left blocks show up in the homepage (however I think you can individually insert those blocks in the ‘home-left’ - the options you have is quite plenty, it’s just a matter which option you think works best for you)

<div class="home-left">
insert your custom menu here .... example:

{{block type="catalog/navigation_custommenu" name="home.catalog.navigation.custommenu" alias="product_custommenu" template="catalog/product/navigation.phtml"}}
</div>

<div class="home-content">
anything else here........example:

{{block type="catalog/product_homepage" name="home.catalog.product.homepage" alias="product_homepage" template="catalog/product/homepage.phtml"}}
</div>

 
Magento Community Magento Community
Magento Community
Magento Community
 
rzazueta
Member
 
Total Posts:  34
Joined:  2008-07-21
 

Ah, right on. That did the trick (actually, the second one did the trick - the <remove> tag threw an error for some reason).

Thanks!

Rob Z.

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