Return to Snippet

Revision: 17936
at September 17, 2009 06:30 by nico65

Initial Code
<reference name="root">
<action method="unsetChild"><alias>breadcrumbs</alias></action>

<reference name="root">
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs">
    <action method="addCrumb">
        <crumbInfo><label>Home</label><title>Go to Home Page</title><link>/</link></crumbInfo>
    <action method="addCrumb">
    <action method="addCrumb">

Initial URL

Initial Description
agento, an open-source PHP ecommerce solution, has a very comprehensive feature list. However, its built-in CMS doesn’t support hierarchical pages. You can fake it, though.

Let’s say you have a page with an SEF (search engine friendly) URL Identifier of “foo”. You’d like to have a subpage “bar” nested under foo. The CMS doesn’t let you create parent-child relationships, but Magento will let you include forward slashes in the SEF URL Identifier so that it is “foo/bar”.

That’s the good news. The bad news is if you want to use the breadcrumbs block, it won’t work out of the box. The Magento CMS is flat, so the default breadcrumbs will always look like “Home / My Page Title.” The optimal solution is to override the breadcrumbs module and parse the SEF URL Identifier and construct the breadcrumbs from that. (I may write a post about it in the future so stay tuned.) The good news for those designers out there, you don’t have to dive into code.

Magento’s CMS has a feature where each page has a way to override its XML layout. When you’re editing a page, go to the “Custom Design” tab. There you’ll see a form field called “Layout Update XML”. This is the key. Here’s where you add XML to first unset the breadcrumbs block and then add it back in but with your specific breadcrumbs. Here’s the code:

Initial Title
How To Fake a Magento Subpage

Initial Tags

Initial Language