Thursday, September 24, 2015

Magento - block not loading (2)

Magento is very case sensitive! While developing your modules / extensions, the best practice to use is to use only the first capital letter in your extension or company name.

Example of bad practice:

Example of good practice:

The reason is in the way Magento parses the filenames. It interprets each capital letter as a new folder!

Also, make sure you reference your blocks in the way you choosed in config.xml file.

For example, if this is your config.xml (part of it):


Then , in your layout.xml ([yourextensionname].xml), you should reference your blocks like this:

            <reference name="creditmemo_totals">
                <block type="cmsubtotals/cmsubtotal" name="cmsubtotal" template="cmsubtotals/cmsubtotals.phtml"/>


Pleaase note we use block type with reference to the setting in our config.xml.

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...