位置:- 正文

phpcms如何调取栏目图片(phpcms采集教程)

编辑:rootadmin
phpcms调取父级栏目图片:【{$CATEGORYS

推荐整理分享phpcms如何调取栏目图片(phpcms采集教程),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:phpcms采集教程,phpcms采集教程,phpcms采集教程,phpcms getshell,phpcms栏目分类,phpcms怎么用,phpcms使用教程,phpcms插件,内容如对您有帮助,希望把文章链接给更多的朋友!

一、phpcms栏目页调用栏目图片的最佳解决方法:

phpcms如何调取栏目图片(phpcms采集教程)

phpcms调用最高父级栏目图片:

{$CATEGORYS[$top_parentid][image]}

phpcms调用直接父级栏目图片:

{$CATEGORYS[$parentid][image]}

phpcms调用当前栏目图片:

{$CATEGORYS[$catid][image]}

phpcms调用指定id的栏目图片:

{$CATEGORYS[78][image]}

假如二级栏目没有设置图片,那么默认调用父级栏目的图片

{if $image}<img src="{$CATEGORYS[$catid][image]}" width="994" height="229" style="border:0px;">{else}<img src="{$CATEGORYS[$top_parentid][image]}" width="994" height="229" style="border:0px;">{/if}

二、如下:

<div class="czb">{pc:content action="category" catid="$top_parentid" num="20" siteid="$siteid" order="listorder ASC"}{loop $data $r}<div class="cbox"><div class="cboxt"><h3><a href="{$r[url]}">{$r[catname]}</a></h3><span><a href="{$r[url]}">更多>></a></span></div><div class="cboxm"><img src="{thumb($r[image],96,96)}" width="96px" height="96px"/><!--wei-->{pc:content action="position" catid="$r[catid]" num="1" order="id DESC" posid="32"}{loop $data $r}<p><a href="{$r[url]}">{str_cut($r[title],36,'..')}</a></p><p>{str_cut($r[description],116,'..')}<a href="{$r[url]}">[详情]</a></p></div>{/loop}{/pc}{pc:content action="lists" catid="$r[catid]" num="5" siteid="$siteid" order="id desc" }<ul>{loop $data $val}<li><span>[{date('m-d',$val[inputtime])}]</span><p><a href="{$val['url']}">{$val['title']}</a></p></li>{/loop}{/pc}</ul></div><!--cbox-->{/loop}{/pc}</div>

相关教程推荐:phpcms教程

本文链接地址:https://www.jiuchutong.com/zhishi/313119.html 转载请保留说明!
下一篇链接:https://www.jiuchutong.com/zhishi/313120.html
免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络