Dedecms filter rule setting tutorial

Source: Internet
Author: User
This time I will introduce you to the use of the dede collection function. The collection function of dede is very popular among webmasters, but some friends who are new to dede may be unfamiliar with this function. For most websites, advertisements are an important source of website revenue. Therefore, advertisement code is often embedded in webpages. How can we filter out the data during Collection? this time I will introduce the use of the dede collection function, which is very popular among webmasters, but some friends who are new to dede may be unfamiliar with this function.
For most websites, advertisements are an important source of website revenue. Therefore, advertisement code is often embedded in webpages. When collecting data, how can we filter it out to avoid having to help others advertise for free? For example, if some keywords in some articles have links to other articles on their own websites, are you willing to include the links in the articles you have collected? All of this requires a simple filtering rule to give you a clean article.
Dede filtering rules are not difficult to write. The statement is as follows:
{Dede: trim} here is the content to be filtered {/dede: trim}
If the content you want to filter is relatively simple code, you can directly write it between "{dede: trim}" and "{/dede: trim, regular expressions are required for complex operations.

1. for example, the rules for removing hyperlinks from the content in the collection are as follows:
{Dede: trim}] *)> {/dede: trim}
{Dede: trim} {/dede: trim}
If you want to remove all hyperlink content, the rule is: {dede: trim}] *)> ([^ <] *) {/dede: trim}
The differences between the two rules are explained using the following code:
For example, the article code contains the following content: HYPERLINK
Through the first rule, the result we collect is: HYPERLINK
Through the second rule, the result we collected is: blank, that is, all content is filtered out.

2. filter advertisements
For advertisements, filtering rules must be used for the content seen in html. for example, some advertisements only reference a JS file, such

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.