0

Currently in the Admin Panel my custom phtml page is under the header: enter image description here

app/code/local/Sean/MasterCreate/Block/Adminhtml/Warehouse/Display.php

<?php

class Sean_MasterCreate_Block_Adminhtml_Warehouse_Display extends Mage_Adminhtml_Block_Widget_form_Container
{
    public function __construct()
    {
        $this->_objectId = 'product_id';
        $this->_blockGroup = 'mastercreate';
        $this->_controller = 'adminhtml_warehouse';
        $this->_mode = 'display';

        $this->setTemplate('finance/action.phtml');

        parent::__construct();
    }

    public function getHeaderText()
    {
        return Mage::helper('mastercreate')->__('MYJ Finance / Inventory');
    }

    //This is automatically tied to where the form action goes/is
    public function getSaveUrl()
    {
        return $this->getUrl('*/warehouse/updateInventory');
    }
}

The getHeaderText() function puts the header text under my phtml page created through the following: app/design/adminhtml/default/default/layout/finance.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <adminhtml_warehouse_createwarehouseform>
        <reference name="content">
            <block type="adminhtml/template" name="warehouse_display" template="finance/action.phtml" />
        </reference>
    </adminhtml_warehouse_createwarehouseform>
</layout>

app/design/adminhtml/default/default/template/finance/action.phtml

<!doctype html>

<html lang="en">
<head>
    <meta charset="utf-8">

    <title>MYJ Finance Page</title>

    <link rel="stylesheet" href="">
</head>

<body>
<h1>Hello</h1>
<script src=""></script>
</body>
</html>

app/code/local/Sean/MasterCreate/controllers/Adminhtml/WarehouseController.php

<?php

class Sean_MasterCreate_Adminhtml_WarehouseController extends Mage_Adminhtml_Controller_Action
{
    public function createWarehouseFormAction()
    {
        $this->loadLayout();
        $this->renderLayout();
        $this->_addContent(
            $this->getLayout()->createBlock('mastercreate/adminhtml_warehouse_display')
        );
        $this->_initLayoutMessages('adminhtml/session'); //this will allow flash messages
    }
}

Where do I specify what comes first? I can edit to display additional files if necessary just let me know!

0
app/design/adminhtml/default/default/template/widget/grid.phtml

there you have nothing usefull. You ccan add something before echo $this->getGridHeader()

or you can try to do something with notices, but it isnt best idea:

Mage::getSingleton('adminhtml/session')->addNotice($this->__('your text'));
  • Well i'm going to put a lot of stuff on the phtml page. But I want it all to be under the header. How can I get the action.phtml to be under the header text – CodingMageSheen Jul 11 '17 at 21:36
  • I don't want to write in the grid.phtml because then It'll apply to all future files I create – CodingMageSheen Jul 11 '17 at 22:41

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.