Home >CMS Tutorial >PHPCMS >How to retrieve column pictures in phpcms
1. The best solution for calling the column image on the phpcms column page:
phpcms calls the highest parent column image:
{$CATEGORYS[$top_parentid][image]}
phpcms calls directly Parent column picture:
{$CATEGORYS[$parentid][image]}
phpcms calls the current column picture:
{$CATEGORYS[$catid][image]}
phpcms calls the column picture with the specified id:
{$CATEGORYS[78][image]}
If the secondary column does not set a picture, then the default Call the picture of the parent column
{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}
2. As follows:
<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>
Recommended related tutorials: phpcms tutorial
The above is the detailed content of How to retrieve column pictures in phpcms. For more information, please follow other related articles on the PHP Chinese website!