1

My module have product questions.

Now i want to display latest 5 question in dashboard using my custom module

enter image description here

How can i do this??

1

you have to rewrite this block to do it.

Mage_Adminhtml_Block_Dashboard

<global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <dashboard>Spacename_Modulname_Block_Adminhtml_Dashboard</dashboard>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>

below function add your template file and show your block

public function __construct()
    {
        parent::__construct();
        $this->setTemplate('dashboard/index.phtml');

    }
  • in index.phtml i can write only my code or i have to copy core phtml code than add my code? – Newbie Oct 27 '15 at 9:48
  • core phtml + your code – Qaisar Satti Oct 27 '15 at 9:51
  • and in this block extends ?? Test_Module_Block_Adminhtml_Dashboard extends Mage_Adminhtml_Block_Dashboard ri8?? – Newbie Oct 27 '15 at 9:56
  • yes you are right – Qaisar Satti Oct 27 '15 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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