解决dedecms调用图片列表时无法控制大小

1.使用织梦dedecms调用图片标签一般为:{dede:arclistsg type=’image.’ imgwidth=’143′ imgheight=’106′ },但是显示出来的图片大小却无法控制!

解决办法:

如果需要在网站其他页面位置(比如首页)调用独立模型的图片列表,需要在{dede:arclistsg }中指定channelid;如:

{dede:arclistsg channelid='-8' type='image.' imgwidth='143' imgheight='106' } 

这样才能保证能够读取到独立某型栏目的图片。

2. 读取到图片之后,无法在模板标签中通过imgwidth、imgheight控制图片的大小;

解决办法:

打开/include/taglib/arclistsg.lib.php ,在192行找到如下代码:

$row['image'] = "<img src='".$row['picname']."' border='0' alt='".ereg_replace("['><]","",$row['title'])."' />"; 

替换为:

$row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."'>"; 

保存,退出,刷新页面,问题即可解决。

注明:本文为星速云原创版权所有,禁止转载,一经发现将追究版权责任!

(0)
上一篇 2022年8月4日 下午12:39
下一篇 2022年8月4日 下午12:39

相关推荐

发表评论

登录后才能评论
问答社区 QQ客服
微信客服
微信客服
分享本页
返回顶部