Home  >  Article  >  Backend Development  >  DedeCms template installation/production overview_PHP tutorial

DedeCms template installation/production overview_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:56:39814browse

◆DedeCms template installation/production overview:

-------------------------------- -----------------------------------------------

The templates of the DedeCms system are not fixed. Users can choose the column template by themselves when creating a new column. The official only provides the most basic default template, which is each template of the built-in system model. Since DedeCms supports custom channel models, users can customize new After adding the channel model, you need to design a new template according to the fields of the model. In addition, DedeCms also supports using templates in the form of styles. The default style is default, which means that the system uses the templates of the folder cmspath/templets/default by default. , if you download a new set of templates, you don’t need to delete the original default file, name the downloaded template folder the style name you want, such as style2, etc., and then modify the default template style name in the background If it is style2, then the system will use the file templets/style2 as the default template. However, if you manually specify the location of the column template, the definition of the background parameter style will be invalid.

1. Concept, design and use of templates, you must understand the following concepts

1. Section (cover) template:
Refers to the website homepage or the use of more important column cover channels The template is generally named with "index_identification ID.htm". In addition, a single page or custom tag defined by the user can also choose whether to support the section template tag. If it is supported, the system will use the section template tag engine to parse it. Only output content or generate specific files.
2. List template:
It refers to the template of the list of all articles in a certain column of the website, generally named with "list_identification ID.htm".
3. File template:
Represents the template of the document viewing page, such as the article template, generally named with "article_identification ID.htm".
4. Other templates:
The general system generally includes templates: home page template, search template, RSS, JS compilation function template, etc. In addition, users can also customize a template to create any file.

2. Naming, the default naming rules for DedeCms templates are as follows

1. Template saving location:
Template directory: cmspath/templets/style name (English, the default is default, where system is The underlying template of the system, plus is the template used by the plug-in)/specific function template file}
2. Template file naming convention:
(1) index_identification ID.htm: Represents the section (column cover) template;
(2) list_identification ID.htm: Represents the column list template;
(3) article_identification ID.htm: Represents the content viewing page (document template, including topic viewing page);
(4) search .htm: Search result list template;
(5)index.htm: Home page template;

Note: [Identification ID] can be obtained in the "Channel Model Management", of course, you can also "Channel Model Management" determines the template naming of a channel.

Example: list_image.htm means that it is the default list template for columns whose content type is picture collection.
Article_article.htm represents the article viewing page template.

3. Other template descriptions

1. Default underlying template
Location: cmspath/templets/system
Function: When there is no default underlying template with a specified tag, the system will Automatically call the corresponding file in this folder as the underlying template.
2. Plug-in directory templates
Location: cmspath/templets/plus
Functions: Templates such as comments, friendly links, RSS maps, etc.
3. Member backend templates
Location: cmspath/member/templets
Function: Member backend templates.

4. Secondary Development

The main template parsing classes of DedeCms are include/inc_arcpart_view.php, include/inc_arclist_view.php, include/inc_archives_view.php, these classes are together with pub_dedetag.php It works. If you want to add some functions to document templates, list templates, and section templates, you can directly modify methods such as ParseTemplet() or ParseTempletsFirst() of these classes, and match the tag names and attributes to the corresponding functions. Function immediate.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318023.htmlTechArticle◆DedeCms template installation/production overview: ---------------- -------------------------------------------------- -------------- The template of the DedeCms system is not fixed. Users can create a new column...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn