Dede Summary length, Dedecms summary limit, dedecms summary words

Source: Internet
Author: User

If you can effectively control the word count of the article summary, then you can make the page layout very flexible.

In Dedecms, the main ways to invoke the article summary on a list page are:

1:[field:info/]
2:[field:description/]
3:[field:info function= "Cn_substr (@me, number of characters)"/]
4:[field:description function= "Cn_substr (@me, number of characters)"/]

Method One:
The first step
Into the database Find the field under Table dede_archives description Point change, field type Select BLOB (some say change to text, but I did not try it)
Step Two
In the Dede directory article_eidt.php name $description = Cn_substr ($description, 250); Here the 250 is not 250 words, but 250 characters, so is not used to 250 this, You can add more than 0 after 250. I tried to do it.
Step Three
In the background, the system---system basic parameters---Other settings---the length of the automatic summary (for example, written as: 250000) (in fact, this place can not be, Dede has been the default is 0-250, here after one or two steps of the change has not worked, any of the lines, "0" except)
Apply, do not set too big, avoid increasing database redundancy
---------------------------
Method Two:
In archives_add.php:$description = CN_SUBSTRR ($description, $cfg _auot_description); archives_edit.php: $description = CN_SUBSTRR ($description, +);
These two statements are used to define the digest,$cfg _auot_description is the variable of the automatic summary length, and 250 is the maximum of the length
But why do you have to specify a length for the abstract?
So this method simply removes the abstract length and changes the code to:
archives_add.php $description = $description;
archives_edit.php $description = $description;

Dede Summary length, Dedecms summary limit, dedecms summary words

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.