How To Customize a Magento Theme and Retain Its Source

不羁岁月 提交于 2020-01-12 08:41:33

问题


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.

My theme is installed at:

.../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?

Thank you for helping.


回答1:


1) In Magento admin: configuration -> design

in default type: the_free_theme

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

now create new folders:

.../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.

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

copy .../app/design/frontend/default/the_free_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.




回答2:


I've found out how it's done, copy the downloaded theme into a new interface!

1) Do this for both the skin and the design folder i.e .../app/design/frontend/default/my_downloaded_theme/ -> .../app/design/frontend/myinterfacename/default

../skin/frontend/default/my_dowloaded_theme -> ../skin/frontend/myinterfacename/default

interfacename can be anything!

now, create a new theme folder both places (skin && design) under same parent folder as the new default theme you just copied.

In this case I call it the main folder. The structure will look something like this:

........../frontend/myinterfacename/main

So under folder myinterfacename you should see a default folder and a main folder.

2) go into admin into design and use myinterfacename/main as your default theme....

this folder is empty therefore it will fallback to the default of myinterfacename which is the downloaded theme you just copied.

Now, for anything you want to change, just copy from default to the new main folder and modify it from there!!!

Good luck!!!



来源:https://stackoverflow.com/questions/12500756/how-to-customize-a-magento-theme-and-retain-its-source

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