How to remove std div in magento

magento

Solution

The div you are looking for is a page/html_wrapper block being added via the cms.xml layout file.

Here is the excerpt taken from app/design/frontend/base/default/layout/cms.xml:

<cms_page translate="label">
        <label>CMS Pages (All)</label>
        <reference name="content">
            <block type="core/template" name="page_content_heading" template="cms/content_heading.phtml"/>
            <block type="page/html_wrapper" name="cms.wrapper" translate="label">
                <label>CMS Content Wrapper</label>
                <action method="setElementClass"><value>std</value></action>
                <block type="cms/page" name="cms_page"/>
            </block>
        </reference>
    </cms_page>

So, there are a couple of ways to remove the div depending on how you develop your themes.

First option would be applicable if you use local.xml:

    <cms_page>
        <reference name="content">
            <action method="unsetChild">
                <alias>cms.wrapper</alias>
            </action>
            <block type="cms/page" name="cms_page"/>
        </reference>
    </cms_page>

Second option would be applicable if you copy the base layout files over:

Copy cms.xml from `app/design/frontend/base/default/layout/cms.xml` to `app/design/frontend/your_package/your_theme/layout/cms.xml` and edit the first layout snippet from above to the following:

   <cms_page translate="label">
        <label>CMS Pages (All)</label>
        <reference name="content">
            <block type="core/template" name="page_content_heading" template="cms/content_heading.phtml" />
            <block type="cms/page" name="cms_page" />
        </reference>
    </cms_page>

Problem

I was trying to remove the "std div" from my magento home page, but unable to find the same any suggestion.

Original source