Not sure what part of the code you already have, here a complete walk-thru on how to add a grid to the CMS Page edit:
I named my example Example_CmsTabGrid:
Module init file:
/app/etc/modules/Example_CmsTabGrid.xml:
<?xml version="1.0"?>
<config>
<modules>
<Example_CmsTabGrid>
<active>true</active>
<codePool>community</codePool>
</Example_CmsTabGrid>
</modules>
</config>
Module config file:
/app/code/community/Example/CmsTabGrid/etc/config.xml:
<config>
<modules>
<Example_CmsTabGrid>
<version>1.0.0</version>
</Example_CmsTabGrid>
</modules>
<global>
<blocks>
<example_cmstabgrid>
<class>Example_CmsTabGrid_Block</class>
</example_cmstabgrid>
</blocks>
<helpers>
<example_cmstabgrid>
<class>Example_CmsTabGrid_Helper</class>
</example_cmstabgrid>
</helpers>
</global>
<adminhtml>
<layout>
<updates>
<example_cmstabgrid>
<file>example_cmstabgrid.xml</file>
</example_cmstabgrid>
</updates>
</layout>
</adminhtml>
</config>
Helper:
/app/code/community/Example/CmsTabGrid/Helper/Data.php:
<?php
class Example_CmsTabGrid_Helper_Data extends Mage_Core_Helper_Abstract
{
}
Layout file to add tab to cms_page_edit:
/app/design/adminhtml/default/default/layout/example_cmstabgrid.xml:
<?xml version="1.0"?>
<layout>
<adminhtml_cms_page_edit>
<reference name="cms_page_edit_tabs">
<action method="addTab">
<name>example_cmstabgrid</name>
<block>example_cmstabgrid/cms_page_edit_tab_grid</block>
</action>
</reference>
</adminhtml_cms_page_edit>
</layout>
And the last file that combines the Tab interface with the Grid combined:
/app/code/community/Example/CmsTabGrid/Block/Cms/Page/Edit/Tab/Grid.php:
<?php
class Example_CmsTabGrid_Block_Cms_Page_Edit_Tab_Grid
extends Mage_Adminhtml_Block_Widget_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Get tab label
*
* @return string
*/
public function getTabLabel()
{
return Mage::helper('example_cmstabgrid')->__('Blocks');
}
/**
* Get tab title
*
* @return string
*/
public function getTabTitle()
{
return Mage::helper('example_cmstabgrid')->__('Blocks');
}
/**
* Check if tab can be displayed
*
* @return boolean
*/
public function canShowTab()
{
return true;
}
/**
* Check if tab is hidden
*
* @return boolean
*/
public function isHidden()
{
return false;
}
public function __construct()
{
parent::__construct();
$this->setId('myTabGrid');
$this->setUseAjax(false);
$this->setDefaultSort('entity_id');
$this->setDefaultDir('DESC');
$this->setEmptyText(Mage::helper('example_cmstabgrid')->__('No records found!'));
}
protected function _prepareCollection()
{
$collection = Mage::getModel('cms/block')
->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$this->addColumn(
'identifier',
array(
'header' => Mage::helper('example_cmstabgrid')->__('Identifier'),
'width' => '200px',
'index' => 'identifier',
)
);
$this->addColumn(
'is_active',
array(
'header' => Mage::helper('example_cmstabgrid')->__('Active'),
'index' => 'is_active',
'type' => 'options',
'options' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toArray(),
)
);
$this->addColumn(
'title',
array(
'header' => Mage::helper('example_cmstabgrid')->__('Title'),
'index' => 'title',
)
);
}
public function getRowUrl($row)
{
return false;
}
}
Hope this helps you with what you are looking for.