2

Here's an example with the About page:

<div class="col-main">
  <div class="std">
    //First line of content entered into UI content editor

When looking inside my 2columns-right.phtml:

<div class="col-main">
  <?php echo $this->getChildHtml('content') ?>

So this tells me this <div class="std"> is somewhere in some template. I've tried grepping my entire Magento directory and find only references under product/view.phtml, list.phtml, and description.phtml. None of these are used for the CMS pages and so I'm at a loss for where I can find these content templates.

The end goal is finding where I can edit the templates to remove unwanted elements like this.

2 Answers 2

9

The answer is in this bit of XML inside of base/default/layout/cms.xml:

<cms_page translate="label">
    ...
    <reference name="content">
        ...
        <block type="page/html_wrapper" name="cms.wrapper" translate="label">
            ...
            <action method="setElementClass"><value>std</value></action>
            <block type="cms/page" name="cms_page"/>
        </block>
    </reference>
</cms_page>

The wrapper block adds a <div> you are looking for and setElementClass method sets the std class on it.

UPDATE

To remove the wrapper "correct" way within local.xml file of your custom theme you have to move cms_page block directly to content block using unsetChild/remove routine and then removecms.wrapper` block.

2
  • Ah good to know. Thanks. Do you know if I just remove the <action> it will remove the div and not mess everything up?
    – o_O
    Commented Feb 24, 2014 at 7:35
  • Please see my update. Commented Feb 24, 2014 at 9:09
1

Just to help some poeple how don't know how to add the code. We have 2 option

Option 1

local.xml as Tim said, see link to know how to: https://stackoverflow.com/questions/11103834/how-to-remove-std-div-in-magento

Option 2

Insert this code inside the cms layout you want to disable the div class="std" tag:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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