The root directory of AnqiCMS templates is/template, each set of templates needs to be in/templateCreate your own template directory and add in the template directory.config.jsonA configuration file is used to specify some information about the template.
config.jsonThe 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.jsonThe fields are all optional. If none are filled, the system will generate them based on the actual situation. The field descriptions are as follows:
nameTemplate name, name according to the actual situationpackageTemplate folder, only supports letters and numbers, please enter the name of your template folder.versionVersion of the template, customdescriptionDescription of the templateauthorTemplate authorhomepageWebsite of the template authorcreatedTemplate creation time, format:2022-05-10 22:29:00template_typeTemplate type, optional values: 0 Adaptive; 1 Code adaptation; 2 Computer + MobilestatusTemplate usage status, optional values: 0 - Disabled, 1 - In use. Only one set of templates can be used in all templates.statusThe value is 1
The template directory and file support 2 modes
Folder organization mode
- Common code
bash.htmlFor example, page headers, footers, and other parts that are inherited by each page are placed here for reference. - Code snippet directory
partial/[en]For example, snippets like sidebars, breadcrumbs, and others are stored here - [en]Home Page
index/index.html - [en]Model Home Page
{模型table}/index.html - [en]Document Details Page
{模型table}/detail.html{模型table}/detail-{文档ID}.html - [en]Document List Page
{模型table}/list.html{模型table}/list-{文档分类ID}.html - Comments List Page
comment/list.html - Online Message Page
guestbook/index.html - Single Page Detail Page
page/detail.htmlpage/detail-{单页ID}.html - Search Page
search/index.html - Tag Home Page
tag/index.html - Label document list page
tag/list.html - 404 error page
errors/404.html - 500 error page
errors/500.html - Site closed prompt page
errors/close.html - Mobile template directory
mobile/The directory structure and template files in the mobile template directory are consistent with the above, just repeat them.
Flat file organization mode
- Common code
bash.htmlFor example, page headers, footers, and other parts that are inherited by each page are placed here for reference. - Code snippet directory
partial/[en]For example, snippets like sidebars, breadcrumbs, and others are stored here - [en]Home Page
index.html - [en]Model Home Page
{模型table}_index.html - [en]Document Details Page
{模型table}_detail.html - [en]Document List Page
{模型table}_list.html - Comments List Page
comment_list.html - Online Message Page
guestbook.html - Single Page Detail Page
page.htmlpage-{单页ID}.html - Search Page
search.html - Tag Home Page
tag_index.html - Label document list page
tag_list.html - 404 error page
errors_404.html - 500 error page
errors_500.html - Site closed prompt page
errors_close.html - Mobile template directory
mobile/The directory structure and template files in the mobile template directory are consistent with the above, just repeat them.
At the same time, some templates also support custom names, such as document details, category pages, and single pages. You can add other filenames to handle different categories and pages that require different templates. If you need to关于我们This single page, if using an independent template, can name the template aspage/about.html, and create a call for a custom template in the background aspage/about.htmlthe About Us page.