Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sharing template between frontend and backend (admin or adminhtml) in magento

I wish to reuse a certain frontend UI element on the backend (under "design/adminhtml"). This would mostly consist of reusing the template (phtml). However, referencing the frontend layout handle from the backend would seem even better. Does magento provide a location for shared UI components, a way to declare them as shared, or a mechanism for referencing them across the frontend/adminhtml divide? Thanks

like image 394
coriscus Avatar asked Mar 18 '12 02:03

coriscus


1 Answers

@coriscus Yes that is possible. I found the trick you use frontend template from admin.

public function __construct()
{
    parent::__construct();
    $this->setData('area','frontend');
    $this->setTemplate('customer/online.phtml');
}

just set needed area in block constructor.

like image 72
Sergey Avatar answered Nov 03 '22 22:11

Sergey