Magento create your own package or use by default

The main reason I like to create a new package is because it allows you to keep a clean separation between your store’s themes and the default Magento themes. On the other hand, most extensions install layouts and template files in app / design / frontend / default / default / , and if your theme is installed in the default package, magento will find the external interface files, you will have to copy the extension files to the application / design / interface / package / default / . So this is a little more work using your own package.

I am curious to know if I am missing anything else, so some of the advantages of creating my own theme package in Magento as opposed to using the default package?

+4
source share
4 answers

First of all, creating a new package is what is required for the Magento user guide.

http://info.magento.com/rs/magentocommerce/images/MagentoDesignGuide.pdf

Here's what he says: “Please ignore the obsolete Magento instructions and tutorials that instruct you to create your own custom theme inside the standard design package or directly edit files in the default / default directory. Rather, the method that provides the best upgrade path for your themes and most of the protection against accidental changes is to create a new design package and create your own theme inside. "

My personal logic for creating a new package is that Magento requires several types of storage, and they have differences, I need to have my own default theme, and exactly what I get when I create my own package (Magento will search for files in my_theme theme in a custom design package, then in the default theme, and then in the source package)

+11
source

If you use standard / standard and third-party extensions, you use their default / default files, then you cannot override these files - you need to edit them directly.

So,

  • fix third-party extension in the supplier / top-level branch
  • using your own package

you can override only those templates / layouts that you need in your package.

+2
source

The two folders / app / design and / skin are identical (mirror image we can tell). Save all css, image files in the directory / skin / your _theme and .phtml for layouts in the folder / app / design / your_theme.

0
source

the default / default package is poorly designed from my point of view. If you use your own package, extensions cannot use your default directory ("Correct?"). I would suggest adding a default field.

Now I use this workaround - config.xml:

<core> <rewrite> <design_package>Your_Extension_Model_Design_Package</design_package> </rewrite> </core> 

Model / Design / Package.php

  class Your_Extension_Model_Design_Package extends Mage_Core_Model_Design_Package { /** * Use this one to get existing file name with fallback to default * * $params['_type'] is required * * @param string $file * @param array $params * @return string */ public function getFilename($file, array $params) { Varien_Profiler::start(__METHOD__); $this->updateParamDefaults($params); $result = $this->_fallback($file, $params, array( array(), //'_package' is new. Uses this package when looking for default theme array('_theme' => $this->getFallbackTheme()), array('_theme' => self::DEFAULT_THEME, '_package' => 'default'), )); Varien_Profiler::stop(__METHOD__); return $result; } } 
0
source

Source: https://habr.com/ru/post/1437644/


All Articles