Home > CMS Tutorial > Empire CMS > How to call the title attribute and intercept the title word count in the Empire CMS smart tag? (code example)

How to call the title attribute and intercept the title word count in the Empire CMS smart tag? (code example)

青灯夜游
Release: 2021-02-22 17:57:48
forward
3752 people have browsed it

How to call the title attribute and intercept the title word count in the Empire CMS smart tag? (code example)

Related recommendations: "Empire cms tutorial"

When Empire cms uses smart tags, we generally use Output the title, as shown below:

[e:loop={"select title,titleurl from xjb_ecms_dzkb where `classid` = '$GLOBALS[navclassid]' order by newstime",1,24,0}]
<li><a href="<?=$bqr[titleurl]?>"><?=$bqr[title]?></a></li>
[/e:loop]
Copy after login

1. How to intercept the number of words in the title with the Empire cms smart tag:

Change the above <? =$bqr[title]?> is replaced with <?=esub($bqr[title],30)?>, where 30 represents the number of bytes, which is the display 15 Chinese characters

II, Empire cms Smart label display title attribute method:

1, in the SQL statement, change the titlefont field as well To select: select titlefont,title,titleurl from......

2, change the above <?=$bqr[title]?>Replace with <?=DoTitleFont($bqr[titlefont],$bqr[title])?>

Third, the empire cms smart label needs to display the title again Attributes, and the method of intercepting the number of words in the title:

Combine the first and second methods, replace <?=$bqr[title]?> with <?=DoTitleFont($bqr[titlefont],esub($bqr[title],30))?>

For more computer programming related knowledge, please visit: Programming video! !

The above is the detailed content of How to call the title attribute and intercept the title word count in the Empire CMS smart tag? (code example). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template