🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## 站点首页 `{siteurl($siteid)}` ## 调用栏目(含栏目图片) ~~~ <ul> {pc:content action="category" catid="12" num="20" siteid="$siteid" order="listorder ASC"} {loop $data $r} <li> <div class="pic"> <img src="{thumb($r[image],359,168)}" /> </div> <a href="{$r[url]}">{$r[catname]}</a> </li> {/loop} {/pc} </ul> ~~~ ## 首页调用指定栏目文章列表(含图片、标题、时间) ~~~ <ul> {pc:content action="lists" catid="6" order="updatetime DESC" num="4" return="info"} {loop $info $v} <li> <img src="{thumb($r[thumb],48,37)}" alt="{$r[title]}"/> <a href="{$v['url']}">{$v['title']}</a> <span>{date('m-d',$v[inputtime])}</span> </li> {/loop} {/pc} </ul> ~~~ ##推荐位 ~~~ {pc:content action="position" posid="2" order="listorder DESC" num="1"} {loop $data $r} <div> <a href="{$r[url]}" target="_blank"> <h3>{str_cut($r[title],20,'')}</h3> <p>{str_cut($r[description],102)}</p> </a> </div> {/loop} {/pc} ~~~ ## 首页调用自定义字段 采用与上面两种调用,关键的地方是 **moreinfo="1"** ~~~ {pc:content action="lists" catid="6" order="updatetime DESC" num="4" return="info" moreinfo="1"} {loop $data $r} {$r['自定义字段名']} {/loop} {/pc} ~~~ ## 友情链接 ~~~ {pc:link action="type_list" siteid="$siteid" order="listorder DESC" num="10" return="dat"} {loop $dat $v} <a href="{$v[url]}" target="_blank">{$v[name]}</a> {/loop} {/pc} ~~~ ~~~ {pc:link action="type_list" siteid="$siteid" linktype="1" order="listorder DESC" num="8" return="pic_link"} {loop $pic_link $v} <li><a href="{$v['url']}" title="{$v['name']}" target="_blank"><img src="{$v[logo]}" width="88" height="31" /></a></li> {/loop} {/pc} ~~~