作者:网站制作 来源:宿州网络公司 [浏览技术资讯] 日期:2019-04-16 17:05:00 浏览次数:196
我们在使用ASPCMS做模板的时候,有时候为了满足首页的特殊样式设计,会在文章调用的时候让其显示一部分文章内容,但文章里面的样式直接调用又会影响网站的排版,经过程序的优化设计,我们发现可以通过修改网站程序达到调用时自动清除样式的功能,具体操作如下。
第一步:
打开\inc\AspCms_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-2019 诚技博源网络科技 All Rights Reserved. 宿州网站建设专家 诚技博源-专业做网站设计的宿州网络公司 皖ICP备15001701号
手机:157-5570-2610 E-mail:cnboco@126.com 地址:宿州市西关君临天下2栋306室