Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

核心主题

wqli78 edited this page Oct 1, 2011 · 1 revision

Themes are responsible for the final presentation of markup to a user, excluding those scenarios where you want a module to send raw JSON / XML (e.g. it is an API).

Themes are structured around some key concepts:

Themes should be self-contained and self-describing.
Themes will be based around layouts, with a default layout that can be copied by other layouts.
Layouts are made up of sections, where each section can include pre-rendered blocks (from modules), or retrieve content directly from the CMS for display.

主题用来向最终用户展示显示效果(除了那些你想发送JSON/XML的模块)。 主题基于以下关键概念:

  • 主题应该可以完全独立,并且可以自我描述。
  • 主题应该基于布局(layout),这样缺省布局可以被其他布局复制。
  • 主题由片段(section)组成,这些片段来自组件(module)渲染后的区块(block)结果,或者直接来之内容。

Structure and Configuration

Themes must be structured as follows:

theme.json :: the theme configuration file /templates :: the folder that contains template sections described in the theme configuration

Within the templates folder, files need to be placed based on the following convention based on the layout names specified in the theme configuration file, so lets visit that first. 结构和配置: 主题必须按以下结构来建立: theme.json :: 主题配置文件 /templates :: 文件夹用来包含以上配置文件中用到的片段

在templates文件夹中,文件需要基于配置文件进行放置,我们先来看一下。