曹え 5811 发布于:2018-08-02 20:22:03
<title>{$GLOBALS['S']['title']}</title> <meta name="keywords" content="{$GLOBALS['S']['keywords']}" /> <meta name="description" content="{$GLOBALS['S']['description']}" />
<title>{$type['classname']}-{$GLOBALS['S']['title']}</title> <meta name="keywords" content="{$type['keywords']} " /> <meta name="description" content="{$type['description']} " />
<title>{$article['title']}-{$type['classname']}-{$GLOBALS['S']['title']}</title> <meta name="keywords" content="{$article['keywords']}" /> <meta name="description" content="{$article['description']}" />
新闻列表:list.html
新闻详情:article.html
单页模板:list_body.html
自定义栏目:list_*.html
自定义详情页:article_*.html
获取栏目字段
typeinfo(a,b)
a:栏目id
b:字段名
例子:{fun typeinfo($topid,'litpic')}
说明:$topid 是当前栏目一级栏目的tid,litpic是栏目的缩略图字段,此例子是获取当前一级栏目的缩略图地址
获取文章字段
ainfo(a,b)
a:文章id
b:字段名
例子:{fun ainfo(56,'title')}
说明:获取文章id为56,的标题
获取文章自定义字段
ainfo2(a,b)
a:文章id
b:字段名
例子:{fun ainfo2($v['id'],'lx')}
说明:获取文章id下面的 lx 字段内容
替换字符
{fun str_replace("<","<",str_replace(">",">",str_replace("'","'",typeinfo(69,'description'))))}
文章循环
{loop table="article" tid="56 trait="1" as="v" limit="12"}
{$v['url']}
{$v['litpic']}
{$v['title']}
{fun date('Y-m-d',$v['addtime'])}
{$v['description']}
{fun newstr($v['description'],20)}
{/loop}
栏目循环
{loop table="classtype" pid="1" mshow="1" limit="7" as="s"}
<li{if($s['tid']==$topid)} class="on"{/if}>
<a href="{if(typeinfo($s['tid'],'murl') == 1 && $url)}{$url}{else}{$s['url']}{/if}">
<em>{$s['title']}</em>{$s['classname']}
</a>
</li>
{/loop}
登录后可以留言提问!
微信扫码登录