Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the special function of dream weaving in DedeCMS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Xiaobian to share with you DedeCMS dream weaving feature how to achieve, I hope you read this article after the harvest, let us discuss it together!

A website will usually launch some targeted thematic content at different times, the function of the topic is actually to retrieve the content of the site according to specific needs, and integrate these different forms of content. We can look at some large portals, such as Sina and Sohu, who have their own thematic channels.

A topic can contain several different columns of content or contain different content models, such as articles, pictures, audio, video, etc. Different topics need to have their own page style in line with the environment at that time, such as in New Year's Day, New Year need red theme template, in spring, summer need green theme theme template, etc.

A good topic is easy to let website members more comprehensive understanding of relevant information, in order to enhance the attention of the website, below we introduce how to use DedeCMS feature to create a topic.

We log in to the background as super administrator and manage topics in [Core]-[Topic Management] of the system.

Because the common management here is similar to document management, some common operations such as add, delete, update, recommend these operations are not described here, this tutorial mainly introduces how to make your own thematic pages through thematic template files.

To create a theme page, you need to prepare two things: content and template. Of course, if you don't have a template file designed by yourself, the system defaults to a set of theme page styles. You can click on the theme type template in the background [Core]-[Content Model Management] to view the following contents:

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 by the user himself, but in general, they are specified in the "Theme Template" of the general parameters when adding a theme.

Of course, there are some topics that do not need to use the content that has been published in the content management system. This topic can be completed directly with static pages without calling tags, but you want to display it in the topic list. In order to solve this problem, it is recommended that users make the topic page into a template file without tags when creating the topic page, and specify the template when adding the topic.

Next, we introduce how the topic function of weaving dreams is divided.

You can see that admin5's topic is generated using a unified topic template. This topic only needs the webmaster to choose to organize the website topic content, and then publish it to present this kind of website topic. Chinaz's project uses independent template files, which makes the project more distinctive and the reading effect more obvious.

DedeCMS comes with a template file that meets most people's requirements for a topic. Here's how to create a topic using the default template file.

Log in to the system background as a super administrator, enter the topic management page, click [Add topic] to enter the topic addition page.

Add topic name, responsible editor, topic description, keywords and main category to the general parameters of the topic, and then enter the "Thematic Documents" tab to select the content of the relevant topic node.

Before we add, let's understand one concept: nodes.

The so-called node is a combination of the same category content in a topic, as shown in the figure below, there are 2 nodes: Coreldraw 9 crash tutorial, Coreldraw 9 tutorial collection, each node selects some articles in the system.

Add the above two nodes in the system settings can be added in two ways, the first is to specify the article list, in a single node "select node article", this way more accurately specify the content of the topic node, in the case of a small number of node content is preferred.

The second way is to automatically obtain documents. This way, you only need to enter the "keyword" of the node to automatically search out the content of articles containing keywords and add them to the content list.

In this way, we have completed the addition of topic content, and published a topic in such a form that the style of the topic page is the default system style. Next, we will introduce how to use the topic template tag to create a special topic page.

The template page needs to understand some of the basic concepts of the dream weaving template engine, you need to know what is the template engine, the use of some template tags of the dream weaving, here if you can use the arclist tag, you can basically make your own theme template.

There are 2 template files involved in the topic:

The requested URL/templets/default/article_spec.htm was not found on this server.

These two files are important files that determine the template of your project style, and of course there is an innertext template, which can be specified separately at each node.

There is also a template tag that the user needs to know about the topic node: {dede:field.note noteid ='ID ID'/}, which is used to generate the list of documents for the topic page.

Design Thematic Page Templates

We first use the relevant tools to design a theme page template file, of course, because we are here to do an example, the focus is on how to explain the process from the page to the template file, so the template file looks relatively simple, if it is a professional artist, you can design a variety of professional template files.

Here I just use Dreamweaver to create a theme template in the web page creation tool. The theme is mainly divided into two parts, the theme content introduction and the node article. Of course, the theme content introduction here has been solidified in the theme template file. Users can also use the template tag {dede:field name ='description '/}, and then add the theme introduction in the background.

Add topic page template tags

From the above content we know that the dream weaving template needs to be added to the page after the dream weaving template tag can be completed, next we will add the template tag. Before tagging, we save the template file designed above as:

The requested URL/templets/default/article_spec2_templets.htm was not found on this server.

First we add common tags: {dede:field.title/}_{dede:global.cfg_webname/}

This tag is added to the template file and before, used to parse the topic title,{dede:field.title/} represents the topic name you added in the background,{dede:global.cfg_webname/} refers to your website name, after the system analysis of dream weaving becomes: DedeCMS V5.3 related content topic_dream weaving unofficial demo site

Of course, in seo, you can add the following code between and

This code adds the keywords you set when adding the topic and the topic description to the page.

The next most important thing is the addition of the topic node part, because the node part is mainly a list, so it involves the concept of an underlying template (innertext), the underlying template has been described in the label syntax introduction of the dream weaving.

Because we can find out from the template file the contents of the single-handedly recorded loop are:

Webmaster college dedecms list page title optimization method

So we can get the innertext from the arclist tag:

[field:typename/][field:title /]

This low-level template we can specify when adding nodes

Next, we add the node label {dede:field.note noteid ='identity '/} to the node part, because we have two node names here, and the ID ID is: use(usage introduction) and exp (experience description), so we replace the loop part in the template page:

use of presentation {dede:field.note noteid='use'/}

This way, our theme template is complete, and we save it as a file named:

The requested URL/templets/default/article_spec2.htm was not found on this server.

Modify Node Container Template

In the template we designed above, there are 2 nodes, because some of our content has been solidified in the template, so if you publish content directly, there will be more node titles. When a node is generated as a page, DedeCMS will read its node container template, so we need to make some modifications to the node container template. We open/templets/system/channel_spec_note.htm This is the default node container template.

~notename~ ~spec_arclist~

There are two tags that need to be introduced here: ~notename~ and ~spec_arclist~

~notename~ The name of the node. During system parsing, this tag will be parsed into the name of the current setting ~spec_arclist~ node content list in the node. The system reads the underlying template file and parses it into the content of the node setting to replace this tag.

The parsed content of this node container is replaced with the {dede:field.note noteid ='ID '/} tag to complete the template parsing, so we need to make some modifications here, because the node name in the previous design has been solidified in the template file, so this part of the content is not involved here. We just need to remove the redundant code and make it directly:

~spec_arclist~

If you don't want to interfere with the use of other template files, we save them as:

/templets/system/channel_spec_note_dedecms.htm

When we add a topic, we can independently set it to:

So far we have completed the production of the theme page template file, the next thing to do is just like the above, directly select the corresponding content to add nodes to publish.

After reading this article, I believe you have a certain understanding of how to realize the dream weaving feature of DedeCMS. If you want to know more about it, welcome to pay attention to the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report