ECSHOP篩選屬性修改title標題

發現百度蜘蛛爬行網站時會爬行屬性連接,並且會進行收錄。但是ecshop系統製做的網站,在分類頁點擊屬性篩選出產品時,網頁title不會改變。這樣就會形成大量title同樣的頁面,不利於優化。爲此,在網上查找ECSHOP篩選屬性修改title的插件,大部分都是收費的。在這裏把本身想到的修改辦法分享給你們。php

須要修改category.php文件,在這個文件查找到優化

foreach ($cat_filter_attr AS $key => $value)

在其前面加上一句代碼網站

$shuxing_name = "";

查找spa

$all_attr_list[$key]['attr_list'][$temp_key]['selected'] = 1;

在後面加上插件

$shuxing_name.=$all_attr_list[$key]['attr_list'][$temp_key]['attr_value'];

查找code

$smarty->assign('page_title', $position['title']);

改成blog

if($shuxing_name!="")
{
$shuxing_name.="_".$position['title'];
}
else
{
$shuxing_name=$position['title'];
}
$smarty->assign('page_title', $shuxing_name);

這樣就能夠實現篩選屬性自動修改title標題了。產品

相關文章
相關標籤/搜索