{"id":1071,"date":"2013-03-13T07:52:21","date_gmt":"2013-03-13T07:52:21","guid":{"rendered":"http:\/\/invisiblezero.net\/?p=531"},"modified":"2013-03-13T07:52:21","modified_gmt":"2013-03-13T07:52:21","slug":"magento-creating-custom-breadcrumbs-for-cms-pages","status":"publish","type":"post","link":"http:\/\/ndthanh.com\/magento-creating-custom-breadcrumbs-for-cms-pages\/","title":{"rendered":"Magento – creating custom breadcrumbs for CMS pages"},"content":{"rendered":"

\"breadcrumb\"<\/p>\n

I wanted to create a subordinate set of CMS pages in Magento so that the breadcrumb navigation at the top of the page looks like this:<\/p>\n

Home > Parent CMS Page > Child CMS Page<\/p>\n

Even though I can specify a hierarchical relationship with the URL key field, it seems to be that all CMS pages in Magento are listed in the root directory by default:<\/p>\n

Home > Child CMS Page<\/p>\n

To override the default, you have 2 options :<\/p>\n

<\/p>\n

1. Update CMS page layout:<\/span> you must insert a bit of XML code into the CMS page’s Design > Page Layout > Layout Update XML field:<\/p>\n

\n\n<reference name="root">\n\n<action method="unsetChild"><alias>breadcrumbs<\/alias><\/action>\n\n<block type="page\/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs">\n\n<action method="addCrumb">\n\n<crumbName>Home<\/crumbName>\n\n<crumbInfo><label>Home<\/label><title>Home<\/title><link>\/<\/link><\/crumbInfo>\n\n<\/action>\n\n<action method="addCrumb">\n\n<crumbName>Parent CMS Page<\/crumbName>\n\n<crumbInfo><label>Parent CMS Page<\/label><title>Parent CMS Page<\/title><link>\/parent-cms-page<\/link><\/crumbInfo>\n\n<\/action>\n\n<action method="addCrumb">\n\n<crumbName>Child CMS Page<\/crumbName>\n\n<crumbInfo><label>Child CMS Page<\/label><title>Child CMS Page<\/title><\/crumbInfo>\n\n<\/action>\n\n<\/block>\n\n<\/reference>\n<\/pre>\n

2. Extend Magento breadcrums functions<\/span> to make it use hierarchy (from Magento EE version)<\/p>\n

… will be updated shortly \ud83d\ude00<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"

I wanted to create a subordinate set of CMS pages in Magento so that the breadcrumb navigation at the top of the page looks like this: Home > Parent CMS Page > Child CMS Page Even though I can specify a hierarchical relationship with the URL key field, it seems to be that all CMS…<\/p>\n

Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,60,45],"tags":[59,62,89],"aioseo_notices":[],"views":5,"_links":{"self":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/posts\/1071"}],"collection":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/comments?post=1071"}],"version-history":[{"count":0,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/posts\/1071\/revisions"}],"wp:attachment":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/media?parent=1071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/categories?post=1071"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/tags?post=1071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}