0

I want to create entire website based on 2 columns only. So I want to remove all one column and 3 column layouts.

I want to remove these options even from the administration area.

How to do this?

4

2 に答える 2

0

次のように (app/code/local またはモジュールを使用して) Mage_Page_Model_Source_Layout::getOptions() を書き直す必要があります。

/**
 * Retrieve page layout options
 *
 * @return array
 */
public function getOptions()
{

    // Array of layout codes that are allowed
    $allowedLayoutCodes = array('empty', 'two_columns_left', 'two_columns_right');

    if ($this->_options === null) {
        $this->_options = array();
        foreach (Mage::getSingleton('page/config')->getPageLayouts() as $layout) {

            // If layoutCode in foreach loop is allowed
            if(in_array($layout->getCode(), $allowedLayoutCodes)) {
                $this->_options[$layout->getCode()] = $layout->getLabel();
                if ($layout->getIsDefault()) {
                    $this->_defaultValue = $layout->getCode();
                }
            }

        }
    }

    return $this->_options;
}
于 2012-09-10T21:53:39.723 に答える
-1

For Remove Layout option from administrative area, you have to edit core file. For this pls comment required layouts in app\code\core\Mage\Page\etc\config.xml.

Please Make sure that you have removed all removed layout references from your frontend theme.

于 2012-09-10T13:55:42.367 に答える