I need to add some extra field to "Page Information" tab in cms->pages. How can i add custom fields from getDefaultEntities() function of my Setup.php file.Can anyone help me ?

  • 1
    For any future googlers; Sandip's answer works well. But even if you have all caches disabled, you should still delete /var/cache folder to get the data to save to the database
    – Maurice
    Commented Jul 15, 2014 at 8:08

1 Answer 1


Adding Custom field into Magento CMS Information Tab at admin side.

Using event observer pattern you can easily add custom field to product information tab in Magento CMS pages.

For e.g. take a field "identifier".

To add this field to product info tab you have to create an extension with this three files and it will add the identifier field to product info tab in admin panel.

Create directory structure like this with these three files:

- local
 - Sandipvaghasiya

1) Now first create an observer that will add our custom field to product information tab for adding it:

\local\ Sandipvaghasiya\CMS\Model\Observer.php

class Sandipvaghasiya _CMS_Model_Observer
    public function cmsField($observer)

        $model = Mage::registry('cms_page');

        $form = $observer->getForm();

        $fieldset = $form->addFieldset('sandipvaghasiya_identifier_fieldset', array('legend'=>Mage::helper('cms')->__('Custom'),'class'=>'fieldset-wide'));
        //add new field
        $fieldset->addField('identifier', 'text', array(
            'name'      => 'identifier',
            'label'     => Mage::helper('cms')->__('Identifier'),
            'title'     => Mage::helper('cms')->__('Identifier'),
            'disabled'  => false,
            //set field value
            'value'     => $model->getIdentifier()

2) Now create a configuration file for our new module.

\local\ Sandipvaghasiya \CMS\etc\config.xml

<?xml version="1.0"?>

3) And now third and last create a file that is used to add our custom field to magento database


$installer = $this;
$installer->run("ALTER TABLE  {$this->getTable('cms_page')} ADD `identifier` varchar( 250 ) NOT NULL DEFAULT 'DEFAULT';");


4) Tell magento that our module to make active, create one xml file


<?xml version="1.0"?>

That’s it we have created a module that will add our custom field to product information tab in magento .

Now clear the magento cache and login to admin panel you will see and newly added field in the information tab.

  • @sadip,I can see the field in page information tab. But value entered is that field are not getting saved to database.
    – Anu
    Commented May 15, 2014 at 9:17
  • @Anu, can you please verify that in the cms_page table your new custom field column is added and it is saved there and please make sure to clear the cache and try this after re login into admin side Commented May 15, 2014 at 9:48
  • 2
    cache is disabled.Column is there in cms_page table.If i add data directly into table means its getting displayed.But when i change and save its not saving.
    – Anu
    Commented May 15, 2014 at 10:00
  • i forgot one thing here that might creating issue for that i am updating the answer please see if it is working Commented May 15, 2014 at 10:08
  • ,Where you have made the change? Can you mention please..
    – Anu
    Commented May 15, 2014 at 10:11

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.