Does template hierarchy work the same in magento as child themes do in wordpress

蓝咒 提交于 2019-12-04 06:59:03

Does template hierarchy work the same in magento as child themes do in wordpress

No.

what is the procedure for updating the theme vis a vis keeping the theme alterations made by the site developer from the original downloaded version

Starting from the bottom, Magento (post 1.4.1.1) has a theme folder at

app/design/frontend/base/default

This is the final place Magento will look for any particular template file. Only people who know why they'd want to edit/add files in there should edit or add files in there. And even most of them shouldn't.

Next up (and this is confusing, so pay attention, and don't feel bad if you're confused), Magento has the concept of a default theme. This is a theme name you configure in

System -> Configuration -> Design -> Themes -> Default Theme

This default folder is where you can put your base theme. If you entered the value theirtheme, Magento would look for theme template and layout files in

app/design/frontend/default/theirtheme/template
app/design/frontend/default/theirtheme/layout

Next up, themes are made up of

  • Layout XML files
  • Templates
  • Translation files
  • "Skin" files (which live outside the app/design hierarchy)

Each of these has a configuration area in

System -> Configuration -> Design -> Themes

So, let's say you configured the Templates config value with the value mytheme, and your Default was set, as above, to theirtheme. Magento would first look for phtml template files in

app/design/frontend/default/mytheme/template/path/to/file.phtml

If it didn't find one there, it would look to the default theme that you configured

app/design/frontend/default/theirtheme/template/path/to/file.phtml

Finally, if it didn't find one in either place, it check one last time in

app/design/frontend/base/default/template/path/to/file.phtml

So, it sounds like what you want to do is make the theme you downloaded your default theme, and then configure a custom folders where you can add your changes.

Other Notes

The word frontend in

app/design/frontend

is a area. An area roughly corresponds to a single web application. The frontend area is the shopping cart, the adminhtml area is the Admin Console.

The first default in

app/design/frontend/default

is the Design Package folder. A design package is a collection of themes. This often causes confusion, since the default package has nothing to do with the default theme, but they share the same, um, default name.

Finally, w/r/t what your theme vendor told you, Magento's still a young platform and it's in flux, and the best practices for these sorts of things are still sorting themselves out. It's often going to be up to you to decide the best way to take advantage of Magento's various systems.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!