Home  >  Article  >  CMS Tutorial  >  How to call the specified column content on the DreamWeaver homepage

How to call the specified column content on the DreamWeaver homepage

藏色散人
藏色散人Original
2019-12-02 09:54:183554browse

How to call the specified column content on the DreamWeaver homepage

How to call the specified column content on the Dreamweaver homepage?

We know that Dedecms is very simple to develop, but the global variables of Dedecms have byte limits, which prevents us from calling large sections of content on the homepage through tags, especially content that contains html tags, but dedecms has another way to call large sections of content, which is to call saved html content through sql statements.

Recommended study: 梦Weavercms

For example, a general corporate website will have a company profile column. Most of us use the {field:content /} tag for this column. to call the column content in the column settings, but this field cannot be used on the home page.

In fact, you can write a sql statement to call the column content on the homepage:

{dede:sql sql='Select content from dede_arctype where id=2'}
[field:content /]
{/dede:sql}

Note that you need to manually modify the data prefix dede_

If the ID of the introduction column is 2, you can Use the above method to call up all company profiles.

If you think there is too much content, we can intercept part of it. The specific sql statement is as follows:

{dede:sql sql='Select content from dede_arctype where id=2'}
[field:contentfunction="cn_substr('@me',200)" /]
{/dede:sql}

The above means that the column content with column ID 2 is called, and only the length of 200 bytes is called.

How about it? Isn’t it very simple? Isn’t it much easier to call the column content on the homepage in the future?

The above is the detailed content of How to call the specified column content on the DreamWeaver homepage. For more information, please follow other related articles on the PHP Chinese website!

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