文章页调用面包屑
点击复制代码 PHP
当前位置:<a href="{$host}">首页</a>
{php}
$html='';
function navcate($id){
global $html;
$cate = new Category;
$cate->LoadInfoByID($id);
$html ='>> <a href="' .$cate->Url.'" title="查看' .$cate->Name. '中的全部文章">' .$cate->Name. '</a> '.$html;
if(($cate->ParentID)>0){navcate($cate->ParentID);}
}
navcate($article->Category->ID);
global $html;
echo $html;
{/php}
分类页调用面包屑
点击复制代码 PHP
当前位置:<a href="{$host}">首页</a>
{php}
$html='';
function navcate($id){
global $html;
$cate = new Category;
$cate->LoadInfoByID($id);
$html ='>> <a href="' .$cate->Url.'" title="查看' .$cate->Name. '中的全部文章">' .$cate->Name. '</a> '.$html;
if(($cate->ParentID)>0){navcate($cate->ParentID);}
}
navcate($category->ID);
global $html;
echo $html;
{/php}
通用面包屑路径
点击复制代码 PHP
当前位置:<a href="{$host}">首页</a>
{php}
$html='';
function navcate($id){
global $html;
$cate = new Category;
$cate->LoadInfoByID($id);
$html ='>> <a href="' .$cate->Url.'" title="查看' .$cate->Name. '中的全部文章">' .$cate->Name. '</a> '.$html;
if(($cate->ParentID)>0){navcate($cate->ParentID);}
}
if($type=='category'){
navcate($category->ID);}
elseif($type=='article'){
navcate($article->Category->ID);
}
global $html;
echo $html;
{/php}
{if $type!='category' && $type!='index'}
>> {$title}
{/if}