设为首页 加入收藏

TOP

DedeCms独立模型调用图片列表图片大小无法控制的解决方法
2011-08-21 04:34:37 来源: 作者: 【 】 浏览:320次 评论:0

DedeCms独立模型调用图片列表图片大小无法控制的解决方法

在使用{dede:arclistsg type='image.' imgwidth='143' imgheight='106' }时,遇到两个问题,在这里把解决小技巧告诉大家:

1.如果需要在网站其他页面位置(比如首页)调用独立模型的图片列表,需要在{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'])."'>";

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

您看到此篇文章时的感受是:
Tags: 责任编辑:administrator
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到QQ空间
分享到: 
上一篇虚拟主机301重定向详细教程,以Ded.. 下一篇解决{dede:arclist keyword='..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

相关栏目

最新文章

图片主题

热门文章

推荐文章

相关文章

广告位