调用标签 | 调用名称 | 备注说明 |
---|---|---|
{$name} | 栏目名称 | |
{$parent.name} | 父栏目名称 | |
当前位置:
<div class="weizhi">当前位置:<i class="fa fa-home"></i><a href="{SITE_URL}">Home</a>{dr_catpos($catid, '', true, '<i class="fa fa-angle-right"></i><a href="[url]">[name]</a>')}</div>
循环同级栏目
调用栏目下级或者同级栏目,当栏目存在下级栏目时就调用下级栏目,如果不存在下级栏目就调用当前栏目的同级栏目
同时适用于 search.html、list.html、category.html、show.html、page.html 模板
{loop $related $c} <li {if $c.id==$cat.id} class="active"{/if}><a href="{$c.url}">{$c.name}</a></li> {/loop}
判断当前栏目是否含有子栏目
{if $cat.child} 有 {else} 没有 {/if}
如果有子栏目则显示子栏目,如果没有,则显示父栏目下子栏目,如果也没有,就显示当前栏目
{if $cat.child} {loop $related $c} <dd><a href="{$c.url}" class="{if in_array($catid, $c.catids)}active{/if}">{$c.name}</a></dd> {/loop} {else if $parent.child} {loop $related $c} <dd><a href="{$c.url}" class="{if in_array($catid, $c.catids)}active{/if}">{$c.name}</a></dd> {/loop} {else} <dd><a href="{$cat.url}" class="active">{$cat.name}</a></dd> {/if}