如果一个网站有多个模型的时候,那么调用这么模型的全部最新文章的K9标签又该怎么写呢?
其实很简单,只须在K9标签的条件where中加mid='模型编号',模型编号指的是新建模型时的模型编号,可以内容等应用的自定义模型列表中查询到。
比如:
新建一个产品模型,它的模型编号为2,那么调用所有的产品最新产品标签条件where中加上mid=2
{@res table='%s_content' field='title,url,date' where='mid=2 and status=1' order='id desc'} {#foreach($res as $rs)} <li><i>[{$rs[date] date='m-d'}]</i><a href="{DIR}{$rs[url]}" title="{$rs[title] code='quote'}">{$rs[title]}</a></li> {#endforeach}
转载请注明出处:唯众网络