[TOC]
## 当前位置显示
~~~
<div class="postion">当前位置
<a href="{siteurl($siteid)}">首页</a>
<span> > </span>
{catpos($catid)} 列表
</div>
~~~
## 当前栏目名称
~~~
{$catname}
~~~
## 获取父栏目id/获取父栏目名称
~~~
{$CATEGORY[$catid][parentid]}
{$CATEGORYS[$CAT[parentid]][catname]}
~~~
## 指定ID栏目名称
~~~
{$CATEGORYS[栏目ID号]['catname']}
{$CATEGORYS[$catid]['catname']}
~~~
## 其他常用调用
~~~
{$r[description]}
{$r[image]}
~~~
## 列表内容显示(带分页)
~~~
<div class="list">
{pc:content action="lists" catid="$catid" num="20" order="id DESC" page="$page"}
<ul>
{loop $data $r}
<li>
<span class="date">
{date('Y-m-d H:i:s',$r[inputtime])}
</span>
<a href="{$r[url]}" title="{$r[title]}">
{$r[title]}
</a>
</li>
{/loop}
</ul>
<div id="pages">
{$pages}
</div>
{/pc}
</div>
~~~
## 显示该栏目下的子栏目
~~~
{if $top_parentid}
{pc:content action="category" catid="$top_parentid" num="15" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
<li>
<a href="{$r[url]}">
{$r[catname]}
</a>
</li>
{/loop}
{/pc}
{/if}
~~~
## 如果栏目下边没有子类,那么显示一级分类
~~~
<?php
if($top_parentid==""){
?>
{pc:content action="category" catid="0" num="100" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
<li><a href="{$r[url]}">{$r[catname]}</a></li>
{/loop}
{/pc}
<?php }else{ ?>
{pc:content action="category" catid="$top_parentid" num="100" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
<li><a href="{$r[url]}">{$r[catname]}</a></li>
{/loop}
{/pc}
<?php } ?>
~~~
## 频道页:
~~~
{php $j=1;}
{loop subcat($catid) $v}
{php if($v['type']!=0) continue;}
<div class="cat_name">
<span class="Nmore"><a href="{$v[url]}">更多»</a></span>
{$v[catname]}
</div>
<div class="list">
<ul>
{pc:content action="lists" catid="$v[catid]" num="5" order="id DESC"}
{loop $data $r}
<li>
<span class="date">
{date('Y-m-d',$r[inputtime])}
</span>
<a href="{$r[url]}" target="_blank" title="{$r[title]}">
{$r[title]}
</a>
</li>
{/loop}
{/pc}
</ul>
</div>
{$j++}
{/loop}
~~~
**如果想在调用五个栏目内容的话,在{$j++}下面加入:**
~~~
{php if ($j>=5) break;}
~~~
**如果要排除某个栏目的循环,可以在`{php if($v['type']!=0) continue;}`下面加入:**
~~~
{php if($v['catid']==7) continue;}
~~~
## 调用指定栏目文章列表
~~~
{pc:content action="category" catid="栏目ID" num="" order="listorder ASC"}
{/if}
{loop $data $r}
<div class=" {if $catid==$r[catid]}高亮标签{/if}">
<a href="{$r[url]}">{$r[catname]}</a>
</div>
{/loop}
{/pc}
~~~
## 频道页调用子栏目和子栏目的内容列表
~~~
{loop subcat($catid) $v}
<a href="{$v[url]}">
<img src="{thumb($v[image],360,180)}" alt="{$v[catname]}" />
</a>
<h4 class="title">
<a href="{$v[url]}">{$v[catname]}</a>
</h4>
<div class="list">
{pc:content action="lists" catid="$v[catid]" num="5" order="id DESC"}
{loop $data $r}
<a href="{$r[url]}">
<img src="{thumb($r[thumb],48,23)}" alt="{$r[title]}" />
</a>
{/loop}
{/pc}
</div>
{/loop}
~~~