0

Considering my extension name - myextensionfolder, the current structure is compatible to CE Magento versions 1.7, 1.8, 1.8.1

app/code/community/myextensionfolder

app/design/frontend/default/default/layout/myextensionfolder
app/design/frontend/default/default/template/myextensionfolder
app/design/adminhtml/default/default/layout/myextensionfolder
app/design/adminhtml/default/default/template/myextensionfolder

skin/frontend/default/default/css/myextensionfolder
skin/frontend/default/default/images/myextensionfolder
skin/frontend/default/default/js/myextensionfolder

After installing it for version 1.9, admin end works as expected but does not work for frontend(only). Though it works by replacing app/design and skin/frontend folders as shown below.

app/design/frontend/rwd/default/layout
app/design/frontend/rwd/default/template

skin/frontend/rwd/default/css
skin/frontend/rwd/default/js
skin/frontend/rwd/default/images

If I put the files in default rwd theme then it does not reflect anything on frontend for ver 1.7-1.8

What should be the correct approach to modify my extension folder structure to make it compatible till version 1.9+ so that user can install it for version 1.7 - 1.9.2.1

P.S. - The question is to alter extension folder structure to make it compatible till version 1.9+ and NOT to simply upgrade Magento Community Edition version.

2 Answers 2

0

I want to emphasise that you are wrong with the assessment of default location of magento extensions or modules.

The default location for frontend is base/default and for admin, default location is default\default. So when you write an an extension, the best practices says, you should use following locations.

app/code/community/myextensionfolder

app/design/frontend/base/default/layout/myextensionfolder
app/design/frontend/base/default/template/myextensionfolder
app/design/adminhtml/default/default/layout/myextensionfolder
app/design/adminhtml/default/default/template/myextensionfolder

skin/frontend/base/default/css/myextensionfolder
skin/frontend/base/default/images/myextensionfolder
skin/frontend/base/default/js/myextensionfolder

The reason for this, Magento uses a fallback mechanism in the case of package\theme. That is it it will loop over different package\theme directory (it depends upon the configuration we have on the system > admin > design section) and if it can't find a file, then finally it will come to the parent package\theme directory. For frontend, this parent package\theme directory is base\default and for admin section, it is default\default

EDIT

For your custom works or for custom modules, you should always use the current package\theme. Modules should also reside under local codepool.

5
  • Agree to your point, and so when user has custom theme, the folders have to manually placed under relevant theme ? Also does the best practice advises to use base/default location for only extension OR for custom module as well ? Commented Sep 25, 2015 at 5:47
  • @Vikram for custom module it should be in the current theme location. that is the best practice for local modules Commented Sep 25, 2015 at 6:06
  • Conclusion: For custom modules, path should be current theme i.e (default/default or custompackage/customtheme) and for extensions it should always be base/default. Pls correct me if I am mistaken. Commented Sep 25, 2015 at 6:31
  • @Vikram you are in the right path. Kudos Commented Sep 25, 2015 at 6:34
  • @Vikram I've edited answer and added it too. Please accept any one of the answer, if it cleared your confusions Commented Sep 25, 2015 at 6:37
0

You can place your theme files in base/default theme.

If your place your extension theme files in base theme it'll work for both default and RWD theme.

i.e.,

app/design/frontend/base/default/layout
app/design/frontend/bsae/default/template

skin/frontend/base/default/css
skin/frontend/base/default/js
skin/frontend/base/default/images
2
  • Why base/default and not default./default ? Is this the correct approach to make it work for all the versions ranging from 1.7-1.9 ? Commented Sep 25, 2015 at 5:43
  • Check this link blog.belvg.com/…. Because the fallback 'll work like that, if any files are not present in our theme it'll look the default in the current package. If the file is not present in current package/default theme. it'll look into the base default theme. So If any one use third party theme with separate package name, our extension theme files will not work. So always use base/default for custom extension. Commented Sep 25, 2015 at 5:54

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.