- 头部:
<title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title> <meta name="keywords" content="{$SEO['keyword']}"> <meta name="description" content="{$SEO['description']}">
-
常用系统常量: {CSS_PATH} {JS_PATH} {IMG_PATH} {APP_PATH}//程序目录例如:
<link type="text/css" rel="stylesheet" href="{CSS_PATH}qi/index.css" /> <script type="text/javascript" src="{JS_PATH}qijs/index.js"></script>
-
模板包含:{template "content","header"} {template "content","footer"}这里是引入头部和尾部
-
常用调用数据
{pc:content action="lists" catid="6" num="8" order="inputtime DESC" } {loop $data $r} <li><span class="date">({date('Y/m/d H:m:s',$r[inputtime])})</span><a href="{$r[url]}" target="_blank" title="{$r[title]}">{str_cut($r[title],'28')}</a></li> {/loop} {/pc} {str_cut(strip_tags($r[description]), 165)}
-
一级栏目调用:
{pc:content action="category" catid="0" num="8" siteid="$siteid" order="listorder ASC"} {loop $data $r} <li><a href="{$r[url]}" title="{$r[catname]}">{$r[catname]}</a></li> {/loop} {/pc}
-
文章列表页调用关键字,或者首页调用关键字:
{pc:content action="lists" catid="$catid" num="10" order="id DESC" page="$page"} {loop $data $r} <a href="{$r[url]}">{$r[title]}</a> php $keywords = explode(',',$r[keywords]);} <b>文章标签:</b> {loop $keywords $keyword} <a href="{APP_PATH}index.php?m=content&c=tag&catid={$catid}&tag={urlencode($keyword)}" class="blue"> {$keyword}</a> {/loop} {/loop} {/pc}
-
当前栏目名称:{$catname}
-
缩略图名称:{$r[thumb]}
-
列表内容显示(带分页):
<div class="news_list2"> <ul> {pc:content action="lists" catid="$catid" num="20" order="id DESC" page="$page"} {loop $data $r} <li><span class="date">{date('Y-m-d H:i:s',$r[inputtime])}</span><a href="{$r[url]}" target="_blank" title="{$r[title]}">{$r[title]}</a></li> {/loop} </ul> <div id="pages" class="text-c">{$pages}</div> {/pc} </div>