The root directory of the AnqiCMS template is/template
, every set of templates needs to be/template
Create your own template directory under and add it to the template directoryconfig.json
Configuration file to illustrate some information about the template.
config.json
The content format of the file is:
{
"name": "默认模板",
"package": "default",
"version": "1.0",
"description": "系统默认模板",
"author": "kandaoni.com",
"homepage": "https://www.kandaoni.com",
"created": "2022-05-10 22:29:00",
"template_type": 0,
"status": 0,
}
config.json
The fields are optional. If they are not filled in, the system will generate them according to the actual situation, and the fields are explained:
name
Template name, name according to actual situationpackage
Template folder, only English letters and numbers are supported. Please fill in the name of your template folder.version
Template version, customdescription
Introduction to the templateauthor
Template Authorhomepage
Template author's websitecreated
Template creation time, format:2022-05-10 22:29:00
template_type
Template type, optional values are: 0 Adaptive; 1 Code adaptation; 2 Computer + Mobilestatus
The usage status of the template, optional value is: 0 Not enabled, 1 is in use. Among all the templates, there can only be one set of templates.status
Value is 1
Template directory and file support 2 modes
Folder organization mode
- Public code
bash.html
For example, the parts inherited by each page such as the header and footer are placed here for reference. - Code snippet directory
partial/
For example, code snippets such as sidebars and breadcrumbs are stored here - front page
index/index.html
- Model homepage
{模型table}/index.html
- Document details page
{模型table}/detail.html
{模型table}/detail-{文档ID}.html
- Document list page
{模型table}/list.html
{模型table}/list-{文档分类ID}.html
- Comment list page
comment/list.html
- Online message page
guestbook/index.html
- Single page details page
page/detail.html
page/detail-{单页ID}.html
- Search Page
search/index.html
- Tag home page
tag/index.html
- Tag Document List Page
tag/list.html
- 404 Error Page
errors/404.html
- 500 Error Page
errors/500.html
- Site closing prompt page
errors/close.html
- Mobile phone template directory
mobile/
The directory structure and template files in the mobile phone template directory are the same as above, just repeat them.
Flat file organization mode
- Public code
bash.html
For example, the parts inherited by each page such as the header and footer are placed here for reference. - Code snippet directory
partial/
For example, code snippets such as sidebars and breadcrumbs are stored here - front page
index.html
- Model homepage
{模型table}_index.html
- Document details page
{模型table}_detail.html
- Document list page
{模型table}_list.html
- Comment list page
comment_list.html
- Online message page
guestbook.html
- Single page details page
page.html
page-{单页ID}.html
- Search Page
search.html
- Tag home page
tag_index.html
- Tag Document List Page
tag_list.html
- 404 Error Page
errors_404.html
- 500 Error Page
errors_500.html
- Site closing prompt page
errors_close.html
- Mobile phone template directory
mobile/
The directory structure and template files in the mobile phone template directory are the same as above, just repeat them.
At the same time, some templates also support custom names, such as document details, classification pages, and single pages. Other file names can be added to handle the situation where different categories and pages require different templates. If necessary, right关于我们
This single page uses an independent template, and the template can be named aspage/about.html
and create a custom template in the background to call it aspage/about.html
Just the About Us page.