Magento退回主题 [英] Magento fall-back on theme

查看:64
本文介绍了Magento退回主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Magento实例上安装了一个主题,我想进一步对其进行自定义.我想像是类似于Magento的后备层次结构,在该层次结构中,我的主题可以回退到默认包,我应该能够以这样一种方式来构造目录,即可以通过保持相似的结构并依靠它来对主题的特定部分进行更改后备.

I installed a theme on my Magento instance, which I'd like to further customize. I imagine that similar to Magento's fallback hierarchy where my theme can fall-back on default packages, I should be able to structure my directories in such a way that I can make changes to particular parts of my theme by maintaining a similar structure and relying on a fall-back.

所以这是我的问题:如何通过这种备用设置来开发另一个主题的儿童主题?是通过以某种方式构造目录来执行此操作,还是以其他方式执行了此操作?

So here's my question: How can I develop a child-theme of another theme, with the fall-back setup this way? Is this performed by structuring directories a certain way, or is this performed some other way?

谢谢!

推荐答案

如果您使用的是Magento EE 1.14或CE 1.9,则可以利用此处描述的方法制作一个儿童主题: http://alanstorm.com/magento_parent_child_themes

If you are using Magento EE 1.14 or CE 1.9 than you can utilize the method described here to make a child-theme: http://www.magentocommerce.com/knowledge-base/entry/ee114-ce19-rwd-dev-guide http://alanstorm.com/magento_parent_child_themes

重要提示:非常重要的是,在 app/design/frontend/custompackage/customtheme/etc目录,其中 准确显示的内容.无法正确配置theme.xml 阻止Magento加载主题.

Important: It's very important you have a theme.xml in the app/design/frontend/custompackage/customtheme/etc directory with exactly the contents shown. Failure to configure theme.xml correctly prevents Magento from loading your theme.

您必须按照说明创建主题结构,并在其中放置一个theme.xml文件,其中包含以下代码:

You must create your theme structure as noted and place a theme.xml file within it, containing the following code:

Magento CE:

Magento CE:

<?xml version="1.0"?>
<theme>
  <parent>custom_package/custom_parent</parent>
</theme>

Magento EE:

Magento EE:

<?xml version="1.0"?>
<theme>
  <parent>custom_package/custom_parent</parent>
</theme>

对于EE v1.8 +或CE v1.4 +版本,您应该在这里参考: http://www.magentocommerce.com/knowledge-base/entry/magentos -主题层次结构

For versions EE v1.8+ or CE v1.4+, you should reference here: http://www.magentocommerce.com/knowledge-base/entry/magentos-theme-hierarchy

层次结构如下:

  1. app/design/frontend/custom_package/custom_theme/&&皮肤/前端/custom_package/custom_theme

如果找不到,那么

  1. app/design/frontend/custom_package/default&& skin/frontend/custom_package/default

如果找不到,那么

  1. app/design/frontend/base/default&&皮肤/前端/基础/默认

如果找不到,那么

  1. 抛出错误

基于此,您可以将默认主题放置在custom_package/default上,并将子主题放置在custom_package/custom_theme上,然后在custom_package/custom_theme上找不到的所有文件都将回退到custom_package/default.无论缺少什么,都将在下一个层次上寻求.

Based on this you could place your default theme at custom_package/default and your child-theme at custom_package/custom_theme, all files not found at custom_package/custom_theme would then fall-back to custom_package/default. Whatever is missing is sought at the next level of hierarchy.

在管理>系统>配置>设计中设置包和主题

Set your Package and Theme at Admin > System > Configuration > Design

这篇关于Magento退回主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆