Table of contents and templates for template making

The root directory of the AnqiCMS template is/template, every set of templates needs to be/templateCreate your own template directory under and add it to the template directoryconfig.jsonConfiguration file to illustrate 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 optional. If they are not filled in, the system will generate them according to the actual situation, and the fields are explained:

  • nameTemplate name, name according to actual situation
  • packageTemplate folder, only English letters and numbers are supported. Please fill in the name of your template folder.
  • versionTemplate version, custom
  • descriptionIntroduction to the template
  • authorTemplate Author
  • homepageTemplate author's website
  • createdTemplate creation time, format:2022-05-10 22:29:00
  • template_typeTemplate type, optional values ​​are: 0 Adaptive; 1 Code adaptation; 2 Computer + Mobile
  • statusThe 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.statusValue is 1

Template directory and file support 2 modes


Folder organization mode

  • Public codebash.htmlFor example, the parts inherited by each page such as the header and footer are placed here for reference.
  • Code snippet directorypartial/For example, code snippets such as sidebars and breadcrumbs are stored here
  • front pageindex/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 pagecomment/list.html
  • Online message pageguestbook/index.html
  • Single page details pagepage/detail.html page/detail-{单页ID}.html
  • Search Pagesearch/index.html
  • Tag home pagetag/index.html
  • Tag Document List Pagetag/list.html
  • 404 Error Pageerrors/404.html
  • 500 Error Pageerrors/500.html
  • Site closing prompt pageerrors/close.html
  • Mobile phone template directorymobile/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 codebash.htmlFor example, the parts inherited by each page such as the header and footer are placed here for reference.
  • Code snippet directorypartial/For example, code snippets such as sidebars and breadcrumbs are stored here
  • front pageindex.html
  • Model homepage{模型table}_index.html
  • Document details page{模型table}_detail.html
  • Document list page{模型table}_list.html
  • Comment list pagecomment_list.html
  • Online message pageguestbook.html
  • Single page details pagepage.html page-{单页ID}.html
  • Search Pagesearch.html
  • Tag home pagetag_index.html
  • Tag Document List Pagetag_list.html
  • 404 Error Pageerrors_404.html
  • 500 Error Pageerrors_500.html
  • Site closing prompt pageerrors_close.html
  • Mobile phone template directorymobile/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.htmland create a custom template in the background to call it aspage/about.htmlJust the About Us page.