By accessing the website and accepting the Cookie Policy, you agree to use the cookies provided by the Site in accordance with to analyze traffic, remember your preferences, and optimize your experience.
October CMS - 快速入门 3 创建主题
October CMS    2018-10-23 10:05:58    83    0    0
emengweb   October CMS

创建主题有两种方法:
1、在octobermovie/themes目录中创建以主题名称为目录名的目录,然后创建主题文件,例如:demo/theme.yaml

name: Demo
description: 'Demo OctoberCMS theme. Demonstrates the basic concepts of the front-end theming: layouts, pages, partials, components, content blocks, AJAX framework.'
author: OctoberCMS
homepage: 'http://octobercms.com'
code: ''

2、使用后台管理工具创建主题,也是今天要讲的方法。
如图,选择【设置】——【前端主题】——【创建空白主题】

点击创建空白主题:根据如下所示填写主题的各个属性。

打开编辑器,可以看到themes目录下多出一个主题目录

下面激活主题:

刷新前端页面:是要提示页面没有找到。

这是因为主题是依赖于页面的。如果主题没有定义任何页面,则会提示上述信息。

另外我们要需要一个布局文件,我们可以使用系统demo中默认的布局文件

我们对布局文件内容进行适当修改。这里我们只是测试页面所以删除header、partial。因为我们需要使用bootstrap和Jquery,所以,需要把demo的资源目录assets也一起复制到新的主题对应目录中。


布局创建好后,刷新页面还是会出现上述错误,这是因为,我们没有创建对应页面。
点击【内容管理系统】——【页面】——【增加】

刷新页面:


上一篇: October CMS资源整理

下一篇: OctoberCMS官方文档 8-组件 (Components)

83 人读过
文档导航