您的位置:首页 > 教程笔记 > 综合教程

zblog的面包屑路径怎么调用

2023-12-04 11:03:25 综合教程 98
文章页调用面包屑

当前位置:<a href="{$host}">首页</a>
{}
$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;
{/}
分类页调用面包屑

当前位置:<a href="{$host}">首页</a>
{}
$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;
{/}
通用面包屑路径

当前位置:<a href="{$host}">首页</a>
{}
$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;
{/}
{if $type!='category' && $type!='index'}
>> {$title}
{/if}

相关推荐