0 items in cart

Please wait, updating cart

Cart is empty.

Total: $0

Checkout

Subscribe Feed

Archive for the ‘Extensions’ Category

Rapid Prototyping for Custom Magento Extensions

I’ve finally had enough of dreading to write all the configuration for each custom module, and invested a couple of hours into this:

http://unirgy.com/wiki/uscaffold

Feedback is welcome as always!

Adding your extension version to admin pages

So you’d like users of your extension to know which version it is, so you can give them support, without asking them to open extension files?

In your helper add this method:


public function addAdminhtmlVersion($module)
{
    $layout = Mage::app()->getLayout();
    $version = (string)Mage::getConfig()
        ->getNode("modules/{$module}/version");

    $layout->getBlock('before_body_end')->append(
        $layout->createBlock('core/text')->setText('

<script type="text/javascript">
$$(".legality")[0].insert({after:"'.$module.' ver. '.$version.'<br/>"});
</script>

        ')
    );

    return $this;
}

And in your controller action, add the method call:


// ADD:
Mage::helper('yourhelper')->addAdminhtmlVersion('Your_Module');
// BEFORE:
$this->renderLayout();

Now on admin pages that were introduced by your module it will show “Your_Module ver. 1.2.3″ right above the Magento version.