A website usually launches some targeted topics in different periods. The feature is to retrieve the site content based on specific requirements, integrate these different forms of content. Here we can look at some large portals, such as Sina and Sohu, which have their own special channels. A topic can contain the content of several different topics or different content models, such as articles, images, audios, and videos. Different topics must have their own page styles that match the current environment, for example, on New Year's Day and New Year, a red topic template is required, and on spring and summer, a green topic template is required. A good topic makes it easy for website members to fully understand the relevant information to enhance their attention to the website. Next we will introduce how to use DedeCMS's special feature to create a topic.
Log on to the background as a super administrator and manage the topics in the [core]-[topic management] of the system.
The common management here is similar to document management. Some common operations such as adding, deleting, updating, and recommending are not described here, this tutorial describes how to use a template file to create a special page.
To create a topic page, you need to prepare two things: content and template. Of course, if you do not have a template file designed by yourself, the system will bring your own topic page style by default, you can go to [core]-[content model management] in the background, and click the topic type template to view the following content:
Document Template:/templets/default/article_spec.htm [Modify] List Template:/templets/default/list_spec.htm [Modify] Channel cover Template:/templets/default/index_spec.htm [Modify] |
These default template files can be modified globally, but are generally specified in the "topic template" of the general parameter when a topic is added.
Of course, some topics do not need to use the content that has been published in the content management system. Such topics can be directly completed using static pages without tags, however, we also hope to display it in the topic list. To solve this problem, we recommend that you make the topic page a template file without tags when creating the topic page, you can specify a template when adding a topic.
Next we will introduce how the topic functions of the dream are divided. We take chinaz two topics page as an example: DedeCms V5.3 classic parsing and Secrets (http://www.chinaz.com/zt/dedecms ).
As you can see, the admin5 topic is generated using a unified topic template. This topic only requires the website administrator to select and organize the website topic content, and then publish it to present such website topics. The chinaz topic uses an independent template file, which makes the topic more distinctive and the reading effect more obvious.
DedeCMS comes with the template file on the topic page to meet the requirements of most people on the topic. Next we will introduce how to use the default template file to create a topic.
Log on to the system background as a super administrator, go to the topic Management page, and go to the add topic page.
Add the topic name, edit responsibility, topic description, keyword, and main category to the common parameters. Next, go to the "topic document" option card to select the content of the relevant topic node.
Before adding a node, we should first understand the concept of node.
The so-called node is a combination of the same classification content in a topic. As shown in the following figure, there are two nodes: Coreldraw 9 quick tutorial and Coreldraw 9 Tutorial summary. Each node selects some articles in the system.
You can add the above two nodes in two ways in system settings. The first method is to specify the article list and select "node article" in a single node ", this method is more accurate to specify the content of the topic node. It is the first choice when the content of the node is small. The second method is to automatically obtain documents. In this method, you only need to enter the "keyword" of the node to automatically search for the content containing keyword articles and add them to the content list.
In this way, we have added the topic content and published a topic in this form. The style of the topic page is the default system style of the system, next we will introduce how to use the topic template tag to create a special topic page.
The template page of the homepage creation topic needs to understand some basic concepts of the dream weaving template engine, what is the template engine, and the use of some template tags of dream weaving, if you use the arclist tag, you can create your own topic template.
The template file involved in the topic contains two files:
/Templets/default/article_spec.htm
/Templets/system/channel_spec_note.htm: the topic node template at the bottom of the system. You must modify the template when creating a node.
These two files are important files that determine the template style of your topic. Of course, there is also an innertext template, which can be specified separately at each node.
Here, you also need to know the template tag of a topic node: {dede: field. note noteid = 'recognition ID'/}. This tag is used to generate a document list on the topic page.
Design the topic page template
First, we will use tools related to creating web pages to design a template file for a special page. Of course, we will provide an example here, focusing on how to process from page to Template File, therefore, the template file looks simple. If you are a professional artist, you can design a variety of professional template files.
Here I only use Dreamweaver to create a topic template in the webpage creation tool. The topic consists of two parts: the topic content introduction and node articles, of course, the content of this topic has been fixed in the topic template file. You can also use the template tag {dede: field name = 'description '/}, then, add the topic introduction in the background.
Add Topic Page template tag
From the above content, we know that the dream template can be created only after the dream template tag is added to the page. Next, we will add the template tag. Before adding tags, we first save the template file designed above as "/templets/default/article_spec2_templets.htm". After saving the template, we can modify this page and add tags, make it a template for the topic page.
First, add the common tag {dede: field. title/}_{ dede: global. pai_webname/}, which is added before the template file <title> and </title> and used for parsing as the topic title. {dede: field. title/} indicates the topic name you added in the background. {dede: global. pai_webname/} refers to the name of your website. After being parsed by the system of Zhimeng, it becomes the DedeCMS V5.3-related content topic _ Zhimeng unofficial demo site.
Of course, you can add the following code between
<Meta name = "keywords" content = "{dede: field. keywords/}"/> <Meta name = "description" content = "{dede: field. description function = 'html2text (@ me) '/}"/> |
This code adds the keywords and topic descriptions you set when adding a topic to the page.
Next, the most important part is the addition of the topic node. Because the node part is mainly a list, it involves the concept of an underlying template (innertext, the underlying template has been described in the label syntax of Zhimeng.
Appendix: Template tag syntax Overview: http://help.dedecms.com/v53/archives/templets/start /.
Because we can find from the template file that the content of the single-pick record loop is:
<Tr> <Td> webmaster College <a href = "#" target = "_ blank"> dedecms list page title optimization method </a> </td> </Tr> |
Therefore, we can obtain the underlying template (innertext) based on the arclist mark ):
<Tr> <Td> [field: typename/] <a href = "[field: arcurl/]" target = "_ blank"> [field: title/] </a> </td> </Tr> |
We can specify this underlying template when adding nodes:
Next we add the node label {dede: field. note noteid = 'identified'/}, because we have two node names here. The IDs are: use (usage introduction), exp (experience description ), therefore, we replace the loop section on the template page:
<Table width = "100%" height = "53" border = "0" cellpadding = "0" cellspacing = "0"> <Tr> <Td width = "2%" bgcolor = "#66CC66"> Usage </td> <Td width = "98%" align = "left"> <table width = "80%" border = "0" cellpadding = "0" cellspacing = "3" id = "nlist"> {Dede: field. note noteid = 'use '/} </Table> </td> </Tr> </Table> |
In this way, our topic template is created. We save it as "/templets/default/article_spec2.htm", which is our topic template file.
Modify node container template
In the template we designed above, there are two nodes, because some of our content has been fixed in the template, so if you directly publish the content, there will be more node titles, when a node is generated as a page, DedeCMS reads its node container template, so we need to make some modifications to the node container template, open "/templets/system/channel_spec_note.htm", which is the default node container template.
<Dl class = "tbox"> <Dt> <strong> ~ Notename ~ </Strong> </dt> <Dd> <Ul class = "d1 io3"> ~ Spec_arclist ~ </Ul> </Dd> </Dl> |
Here we need to introduce two tags :~ Notename ~ And ~ Spec_arclist ~
~ Notename ~ : Name of the node. During system resolution, the label is resolved to the name currently set in the node.
~ Spec_arclist ~ : Node content list. The system reads the underlying template file and parses it into the content set by the node to replace it with this tag.
The parsed content of this node container is the same as {dede: field. note noteid = 'identified'/} is replaced to complete template parsing. Therefore, we need to modify it here, because the node name in the previous design has been fixed in the template file, this part of content is not involved here. We only need to remove the redundant part of the code and directly change it:
If you do not want to affect the use of other template files, save them as "/templets/system/channel_spec_note_dedecms.htm". When adding a topic, we can set it:
So far, we have completed the creation of the template file for the topic page. Next, we only need to select the corresponding content and add the node for publishing as described above.
The topic functions of Zhimeng are more powerful. Users of Zhimeng need to learn it carefully. This article has fully introduced how to use the topic functions, some files designed in this article can be downloaded from the attachment. For demonstration on the page, see http://www.dedemo.cn/news/cms/2008/1231/640.html.