Search code examples
phpmagentomagento-1.9adminhtml

Magento 1.x Best way to get admin skin URL from frontend


What is the best way of getting the URL path of the current admin skin theme directory.

I am aware of

Mage::getModel('core/design_package')->getSkinUrl();

Which will return the URL of the front-end skin theme directory. Is there an Adminhtml equivalent?

Many thanks


Solution

  • For admin skin url, you can use:

    <?php echo Mage::getDesign()->getSkinBaseUrl(array('_area'=>'adminhtml')) ?>
    

    This method can be found in app/code/core/Mage/Core/Model/Design/Package.php.

    You can also pass other params via the array like _package and _theme if you want the url of certain package/theme.