PHPCMS如何调用后台的勾选的“首页焦点图推荐”?最近刚开始上手,折腾了半个小时,终于完全弄明白,特此笔记,高手可以绕行了。
{pc:content action="position" posid="1" order="listorder DESC" thumb="1" num="5"}
推荐位
action="position"
指定推荐位ID(1为首页焦点图)
posid="1"
指定排序类型
order="listorder DESC"
推荐位缩略图(1为是)
thumb="1"
数据调用数量
num="5"
{pc:content action="position" posid="1" order="listorder DESC" thumb="1" num="5"} <ul> {loop $data $v} <li><a href="{$v[url]}"><img src="{thumb($v[thumb],400,0)}" alt="{$v[title]}" /></a><br> <p class="title"><a href="{$v[url]}">< {$CATEGORYS[$v['catid']]['catname']} ></a></p></li> {/loop}
{$v[url]}
=
{$CATEGORYS[$v['catid']]['url']}" />