I was wondering if there is a way to hook into the front page layout, other than

<cms_index_index>...</cms_index_index>  

Given I don't know everyhing about Magento, and the too-general looking route above, It's not too far fetched to assume that this layout is loaded at other instances other than store-front-page. I wouldn't want that.

Specifically, what I'm trying to do is to append blocks to the content block, only if It's the store front page.

有帮助吗?

解决方案

I can tell you for sure that <cms_index_index> is the layout handle used for homepage, what ever that page is.
This is not loaded for any other page unless you specify in the layout handle for that page to do so using <update handle="cms_index_index" />. I doubt this is the case for you.

An other option is to add the xml layout directly in the admin for the page you selected as homepage. The down side of this is that if you change the homepage to an other cms page you need to add the xml again.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top