1

I have a CMS page used for the homepage on the site with the identifier 'homepage'.

I have also called some extra blocks inside local.xml inside the <cms_index_index> tag in local.xml, see below (for example the home.featured.products block called at the bottom of the page) :

<cms_index_index translate="label">

    <label>CMS Home Page</label>
    <!--remove the default CMS page heading and content blocks so they don't appear at the top of the page-->
    <remove name="page_content_heading" />
    <remove name="cms.wrapper" />

    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/jquery/column-height-init.js</name><params/></action>
    </reference>

    <!--create homepage structure - homepage.blocks holds all the other blocks so we can control the layout better-->
    <reference name="content">
        <block type="core/template" name="homepage.blocks" template="cms/homepage/homepage-blocks.phtml">
            <block type="qbanner/qbanner" name="qbanner.home" template="qaz/qbanner/qbanner.content.top.phtml" />
            <block type="core/template" name="home.collection.links" template="cms/homepage/collection-links.phtml" />
            <!--<block type="core/template" name="latest.news.home" template="cms/homepage/latest-news-home.phtml" />-->
            <block type="core/template" name="rss.feed" template="cms/homepage/rss-feed.phtml" />
            <block type="core/template" name="featured.products" template="catalog/product/featured-products.phtml" />
            <block type="core/template" name="latest.blog.home" template="cms/homepage/latest-blog-home.phtml" />
            <block type="core/template" name="twitter.feed" template="cms/homepage/twitter-feed.phtml" />
            <!--call the heading and content for the home again here (different template files from normal CMS pages now)-->
            <block type="core/template" name="page_content_heading.home" template="cms/homepage/content_heading.phtml" />

            <block type="page/html_wrapper" name="cms.wrapper.home" translate="label">
                <label>CMS Content Wrapper</label>
                <action method="setElementClass"><value>std</value></action>
                <block type="cms/page" name="cms_page"/>
            </block>
        </block>
    </reference>
</cms_index_index>

My problem is that this is working fine if I go to http://www.mysite.com/, but if I go to http://www.mysite.com/homepage then the XML above is not being applied, I guess because http://www.mysite.com/homepage is not treated as the CMS index?

I have set the Home page in System...Config...Web..Default Pages as this page.

Is there any way I can overcome this? I have a complaint from a client that the "Preview" link in the Magento admin panel under CMS...Pages is not showing the homepage correctly (because the Preview link is going to http://www.mysite.com/homepage)

I'm using Magento 1.8.1.0... thanks!

3

What about putting a line into your .htaccess to rewrite the /homepage URL to the / one? This would not only solve your problem but would be good for SEO, since you wouldn't have duplicate content.

e.g. Redirect 301 /homepage /

3

just copy (cut) your xml content and paste it in the desing -> Layout Update XML of your page

Eg: CMS->Page

edit your page and navigate to Design on left, in the Layout Update XML paste your xml content here

  • Doing this means that when viewing mysite.com all the blocks are called on the page twice, once by local.xml and once by the Custom Design. – Sarah Feb 25 '14 at 16:12
  • You can eliminate the local.xml content once this is done. – benmarks Feb 25 '14 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.