前端調(diào)用代碼<div itemscope itemtype="https://schema.org/BreadcrumbList">{eyou:position/}</div>
/core/library/think/template/taglib/eyou/TagPosition.php這個文件121后的代碼改成如下。
$str = "<span itemprop='itemListElement' itemscope itemtype='https://schema.org/ListItem'><a href='{$home_url}' class='{$style}' itemprop='item'> <span itemprop='name'>{$basic_indexname}</span></a><meta itemprop='position' content='1'></span>";
$result = model('Arctype')->getAllPid($typeid);
$i = 1;
foreach ($result as $key => $val) {
if ($i < count($result)) {
$z = $i+1;
$str .= " {$symbol} <span itemprop='itemListElement' itemscope itemtype='https://schema.org/ListItem'> <a href='{$val['typeurl']}' class='{$style}' itemprop='item'><span itemprop='name'>{$val['typename']}</span></a><meta itemprop='position' content='$z'></span>";
} else {
$i = $i+1;
$str .= " {$symbol} <span itemprop='itemListElement' itemscope itemtype='https://schema.org/ListItem'> <a href='{$val['typeurl']}' itemprop='item'><span itemprop='name'>{$val['typename']}</span></a><meta itemprop='position' content='$i'></span>";
}
++$i;
}
return $str;
}
}