帝国CMS灵动标签显示标题属性、截取标题字数

 3018

帝国cms采用灵动标签时,我们一般用 <?=$bqr[title]?> 输出标题,如下:

[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]


一、帝国cms灵动标签截取标题字数的方法:

将上面的 <?=$bqr[title]?> 换成 <?=esub($bqr[title],30)?> ,这里面的30代表字节数,也就是显示15个汉字


二、帝国cms灵动标签显示标题属性的方法:

1、在SQL语句中,将 titlefont 字段也要选取出来:select titlefont,title,titleurl from......

2、将上面的 <?=$bqr[title]?> 换成 <?=DoTitleFont($bqr[titlefont],$bqr[title])?>


三、帝国cms灵动标签又要显示标题属性,又要截取标题字数的方法:

将一、二方法综合一下,将 <?=$bqr[title]?> 换成 <?=DoTitleFont($bqr[titlefont],esub($bqr[title],30))?>


本文网址:https://www.zztuku.com/detail-7757.html
站长图库 - 帝国CMS灵动标签显示标题属性、截取标题字数
申明:如有侵犯,请 联系我们 删除。

评论(0)条

您还没有登录,请 登录 后发表评论!

提示:请勿发布广告垃圾评论,否则封号处理!!

    编辑推荐

    实用文字遮罩3D效果