1

I want to call two phtml in frondend which is admin side phtml

is it possible to call phtml of backend in customer account?

if yes than i want to call this two phtml:

adminhtml\default\default\template\downloadable/product/edit/downloadable/samples.phtml

adminhtml\default\default\template\downloadable/product/edit/downloadable/links.phtml

how to call this phtml?

1 Answer 1

2

In theory you can do it, I think, by emulating the backend for a frontend area. You can do the emulation like this:

$adminStoreId = 0;
$appEmulation = Mage::getSingleton('core/app_emulation');
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($adminStoreId); 
//your magic here
//then stop the emulation
$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);

But this is not a good practice. If you have urls in the templates you mentioned then they will be generated using the admin helper and you end up with a strainge key parameter.
Not to mention that it may not fit with your design.
I suggest you just clone the templates to frontend and keep frontend separate from backend.

3
  • awasome concept @marius
    – Amit Bera
    Commented May 6, 2015 at 11:36
  • 3
    @AmitBera. It's not mine :) Magento thought of it.
    – Marius
    Commented May 6, 2015 at 11:38
  • nice catch @Marius
    – Keyur Shah
    Commented May 6, 2015 at 12:02

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.