Skip to main content
 Web开发网 » 站长学院 » 织梦教程

dedecms独立模型无法控制图片大小

2020年09月12日6530百度已收录

在dedecms网站中调用图片的标签中就可以限制图片的大小,但是有的时候这样的标签是没有效果的,所以在调用的时候就起不到控制图片大小的作用了。

 

解决DedeCMS独立模型无法控制图片大小的方法:

 

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

 

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

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

 

2、打开/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'])."'>";


 

评论列表暂无评论
发表评论
微信