如何自定义Magento主题并保留其来源 [英] How To Customize a Magento Theme and Retain Its Source

查看:86
本文介绍了如何自定义Magento主题并保留其来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行Magento 1.7.0.2(最新)

Running Magento 1.7.0.2 (latest)

我下载了一个免费主题并安装了它-没问题.

I downloaded a free theme and installed it - no problem.

我希望开始对其进行细微的编辑,但我不想触及其来源.我想在目录中进行编辑,这些编辑将呈现并覆盖基本的自定义主题,但如果要发布免费版本,则要升级免费主题,则不要浪费它们.

I wish to start making subtle edits to it but I do not want to touch the source. I want to make the edits in a directory where they will render and override the base custom theme yet not get trashed if I were to upgrade the free theme should a newer version get released.

我的主题安装在:

.../app/design/frontend/default/the_free_theme/
../skin/frontend/default/the_free_theme/

我将创建哪种目录结构来复制自定义主题中的选定主题文件,以使它们覆盖基本文件,但在升级时不会被删除?

What directory structure would I create to copy selected theme files from the custom theme so that they overrode the base file but would not get deleted in the event of an upgrade?

感谢您的帮助.

推荐答案

1)在Magento管理员中:配置->设计

1) In Magento admin: configuration -> design

默认类型:the_free_theme

in default type: the_free_theme

现在在皮肤",模板"和布局"字段中,键入"my_new_theme"(或您想调用的名称).

now in skin, templates and layouts fields, type "my_new_theme" (or what ever you want to call it).

现在创建新文件夹:

.../app/design/frontend/default/my_new_theme/
../skin/frontend/default/my_new_theme/

任何要从模板复制到新文件夹中的文件都将更改,这些文件将覆盖基本模板文件,使它们保持原样.

Any files you want to change from the template you copy into the new folder and they will override the base template files, keeping them in tact.

例如,如果您想更改heeader模板:

for example, if you want to change the heeader template:

复制.../app/design/frontend/default/the_free_theme/template/page/html/header.phtml

copy .../app/design/frontend/default/the_free_theme/template/page/html/header.phtml

到.../app/design/frontend/default/my_new_theme/template/page/html/header.phtml

to .../app/design/frontend/default/my_new_theme/template/page/html/header.phtml

,然后编辑新文件.这将覆盖基本模板文件.

and then edit the new file. this will override the base template file.

这篇关于如何自定义Magento主题并保留其来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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