Gallery: 外观主题:如何编辑一个现有的外观主题:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
 
第1行: 第1行:
If you'd prefer to make minor changes to an existing theme rather than creating a new one, follow these steps. By doing so you'll ensure that when you upgrade your Gallery, your theme edits won't be overwritten. Gallery's theme system will load style sheet and template files from folders named 'local' instead of the theme's core files. Just make a 'local' folder then make a copy of the file you wish to edit. The following steps are specific to the matrix theme—just replace matrix with your chosen theme (siriux, floatrix, carbon, etc.).
如果你想对某个已有外观主题做小修改而不想新建一个的话,请按照如下步骤行事。这样一来,在升级gallery时,你就能保证对外观主题所作的编辑不会被覆盖掉。Gallery的外观主题系统会从名为'local'的文件夹(而非外观主题核心文件夹)中载入风格页。因此建议个'local'文件夹并将想要编辑的文件拷贝放入其中。接下来的步骤针对matrix外观主题而言—将matrix换成你所选的外观主题即可(siriux,floatrix,carbon等)。


== Edit an Existing Theme's CSS File ==
== 编辑现有外观主题的CSS文件 ==


# In your chosen theme's folder (ex. themes/matrix/), create a new folder named 'local', not to be confused with locale which contains language translation files.
# 在你选择的外观主题文件夹中(例如themes/matrix/),新建一个名为'local'的文件夹,不要与含有翻译文件的locale文件夹混淆了。
# Make a copy of theme.css and move it to the 'local' folder
# 做一份theme.css的拷贝,并将其移动到'local'文件夹中
# Edit themes/matrix/local/theme.css
# 编辑themes/matrix/local/theme.css


== Edit an Existing Theme's Template Files ==
== 编辑现有外观主题的模板文件 ==


# In your chosen theme's folder (ex. themes/matrix/templates), create a new folder named 'local'
# 在你选择的外观主题文件夹中(例如themes/matrix/),新建一个名为'local'的文件夹
# Make a copy of the template you wish to edit in the 'local' folder (theme.tpl, album.tpl, photo.tpl, etc.)
# 做一份要编辑的模板的拷贝,并将其移动到'local'文件夹中(theme.tpl,album.tpl,photo.tpl等)
# Edit your copied template files in themes/matrix/templates/local/
# 编辑themes/matrix/templates/local/中你复制过来的模板文件
# See: [[Gallery:Editing_Templates|Editing Templates]]
# 参见:[[Gallery:Editing_Templates|模板的编辑]]




Important: If you made some changes, but you still can't see the change:<br/>
重点:如果你做了修改,但仍无法看到这些修改效果的话: <br/>
Be sure to flush caches (under siteadmin/maintenance) and/or turn off page level caching (under siteadmin/performance) before you try debugging deeper.
在尝试执行深入的debug之前,确定清空缓存(在siteadmin/maintenance下)了并/或关闭了页面级缓存(在siteadmin/performance下)

2008年10月27日 (一) 15:19的最新版本

如果你想对某个已有外观主题做小修改而不想新建一个的话,请按照如下步骤行事。这样一来,在升级gallery时,你就能保证对外观主题所作的编辑不会被覆盖掉。Gallery的外观主题系统会从名为'local'的文件夹(而非外观主题核心文件夹)中载入风格页。因此建议个'local'文件夹并将想要编辑的文件拷贝放入其中。接下来的步骤针对matrix外观主题而言—将matrix换成你所选的外观主题即可(siriux,floatrix,carbon等)。

编辑现有外观主题的CSS文件[ ]

  1. 在你选择的外观主题文件夹中(例如themes/matrix/),新建一个名为'local'的文件夹,不要与含有翻译文件的locale文件夹混淆了。
  2. 做一份theme.css的拷贝,并将其移动到'local'文件夹中
  3. 编辑themes/matrix/local/theme.css

编辑现有外观主题的模板文件[ ]

  1. 在你选择的外观主题文件夹中(例如themes/matrix/),新建一个名为'local'的文件夹
  2. 做一份要编辑的模板的拷贝,并将其移动到'local'文件夹中(theme.tpl,album.tpl,photo.tpl等)
  3. 编辑themes/matrix/templates/local/中你复制过来的模板文件
  4. 参见:模板的编辑


重点:如果你做了修改,但仍无法看到这些修改效果的话:
在尝试执行深入的debug之前,确定清空缓存(在siteadmin/maintenance下)了并/或关闭了页面级缓存(在siteadmin/performance下)。