The root directory of AnqiCMS template is/templateEach set of templates needs to be in/templateCreate your own template directory and add it in the template directoryconfig.jsonConfiguration file to describe 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 in, the system will generate according to the actual situation, and 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.versionTemplate version, customizabledescriptionTemplate introductionauthorTemplate authorhomepageTemplate author's websitecreatedTemplate creation time, formatted as: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.statusValue is 1
Template directory and file support 2 modes
Folder organization mode
- Public code
bash.htmlFor example, the header, footer, and other parts inherited by each page are placed here for reference. - Code snippet catalog
partial/For example, the sidebar, breadcrumb, and other code snippets are stored here. - Home
index/index.html - Model homepage
{模型table}/index.html - Document detail 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留言页
guestbook/index.html - a single page detail page
page/detail.htmlpage/detail-{单页ID}.html - Search Page
search/index.html - Tag homepage
tag/index.html - Tag 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, repeat them as needed.
Flat file organization mode
- Public code
bash.htmlFor example, the header, footer, and other parts inherited by each page are placed here for reference. - Code snippet catalog
partial/For example, the sidebar, breadcrumb, and other code snippets are stored here. - Home
index.html - Model homepage
{模型table}_index.html - Document detail page
{模型table}_detail.html - Document list page
{模型table}_list.html - Comment list page
comment_list.html - Online留言页
guestbook.html - a single page detail page
page.htmlpage-{单页ID}.html - Search Page
search.html - Tag homepage
tag_index.html - Tag 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, repeat them as needed.
At the same time, some templates also support custom names, such as document details, category pages, and single pages, which can add other filenames to handle different categories and pages requiring different templates. If you need to关于我们This single page, using an independent template, can be named the template aspage/about.htmland create a custom template call in the background forpage/about.htmlthe About Us page.