Home >CMS Tutorial >DEDECMS >How to intercept strings in dedecms arclist
How to intercept strings in dedecms arclist?
This article mainly introduces two methods of intercepting strings in dedecms arclist, one is the common titlelen parameter method, and the other is the cn_substr function method. Friends in need can refer to it
Recommended learning: Dreamweaver cms
Method 1:
The code is as follows:
{dede:arclist typeid=’9′ titlelen=’40′ orderby=” limit=’0,5′} <li><a href=”#” target=”_blank”>[field:title /]</a></li> {/dede:arclist}
Instructions: arclist, the detailed parameter description is in There are detailed instructions in the background template, please refer to the introduction there for details. Among them: titlelen, the number of strings can be intercepted, which means outputting 20 Chinese characters
Method 2:
The code is as follows:
{dede:arclist typeid=’9′ titlelen=’40′ orderby=” limit=’0,5′} <li><a href=”#” target=”_blank”>[field:title function="cn_substr(@me,10)"/]</a></li> {/dede:arclist}
Instructions: [field: title function="cn_substr(@me,10)"/], which means: intercept the first 10 characters of the field title, that is, 5 Chinese characters
The above is the detailed content of How to intercept strings in dedecms arclist. For more information, please follow other related articles on the PHP Chinese website!