作者:仁品科技 来源:本站 [浏览技术资讯] 日期:2019-06-01 17:23:22 浏览次数:99
我们在使用ASPCMS做模板的时候,有时候为了满足首页的特殊样式设计,会在文章调用的时候让其显示一部分文章内容,但文章里面的样式直接调用又会影响网站的排版,经过程序的优化设计,我们发现可以通过修改网站程序达到调用时自动清除样式的功能,具体操作如下。
第一步:
打开incAspCms_MainClass.asp
if len(decodeHtml(DateArray(6,i)))>infolen then
nloopstr = replace(nloopstr,matchfield.value,left(replace(decodeHtml(DateArray(6,i)),"{aspcms:page}",""),infolen))&"…"
else
nloopstr = replace(nloopstr,matchfield.value,left(replace(decodeHtml(DateArray(6,i)),"{aspcms:page}",""),infolen))
end if
修改后的代码:
if len(decodeHtml(DateArray(6,i)))>infolen then
nloopstr = replace(nloopstr,matchfield.value,left(replace(dropHtml(DateArray(6,i)),"{aspcms:page}",""),infolen))&"…"
else
nloopstr = replace(nloopstr,matchfield.value,left(replace(decodeHtml(DateArray(6,i)),"{aspcms:page}",""),infolen))
end if
将蓝色代码修改成红色代码即可。
第二步
找到
if len(pagecontent)>contentlen then pagecontent=left(pagecontent,contentlen)&"..." 替换为
if len(pagecontent)>contentlen then pagecontent=left(dropHtml(pagecontent),contentlen)&"..."
经常上述两步操作之后,清除自带样式的功能就可以实现了。还有这种烦恼的小伙伴可以抓紧时间去操作试一下了。
官方微信
手机网站
Copyright © 2018-2022 仁品网络科技 All Rights Reserved. 呼和浩特网站建设专家 仁品科技-专业做网站设计的呼和浩特网络公司 蒙ICP备17002152号-1
手机:185-4706-8673 E-mail:282633714@qq.com 地址:内蒙古自治区呼和浩特市赛罕区世纪七路