联系电话:020-28187900

如何实现用标签输出第一篇文章带有描述的?

发表时间:2012-08-07 阅读: 2032

如何在列表页中用K9标签输出第一篇文章带有描述的,其余忽略描述呢?

效果如下查看
标题1
       描述
标题2
标题3

K9标签示例:

{@res.join table1='%s_content_categroy_bind' table2='%s_content' field2='title,url,date,description'on='id'where='t2.mid=1 and t2.status=1 and cid=36' order='t2.id desc' number='7'}
{#foreach($res as $key=>$rs)}
{#if($key==0)}
<ul>
<li><a href="{DIR}{$rs[url]}">{$rs[title]}</a>
<p>{$rs[description] size='70'}</p>
</li>
</ul>
{#else}
{#if($key==1)}
<ul>
{#endif}
<li><a href="{DIR}{$rs[url]}" title="{$rs[title]}">{$rs[title]}</a><span>{$rs[date] date="Y-m-d"}</span></li>
{#if($key==count($res)-1)}
</ul>
{#endif}
{#endif}
{#endforeach}
{#if($key==0)}:输出带描述

{#if($key==1)}:输出不带有描述

转载请注明出处:唯众网络


相关教程 【更多】

唯众网络