ecshop 怎样设置内页关键词
ecshop 的产品内容页 seo 都可以通过后台进行单独的设置,对于 seo 的优化很有帮助,但个别的内页是无法进行描述的,比如搜索的页面链接 search.php?intro=best,flow.php,message.php,像这种类型的都属于单页类型了吧,我们知道,对于站内搜索,搜索引擎也会进行蜘蛛抓取的,我们来稍微的改进一下。
打开includes/lib_main.php,找到如下函数代码:
function assign_ur_here($cat = 0, $str = '')
elseif ('exchange' == $filename)
{
$page_title = $GLOBALS['_LANG']['exchange'] . '_' . $page_title;
$args = array('wsid' => '0');
$ur_here .= ' <code>></code> <a href="exchange.php">' .
$GLOBALS['_LANG']['exchange'] . '</a>';
}
elseif ('search' == $filename)//获取当前页的地址参数...如:search.php?intro=best 得到search
{
$action = unserialize(base64_decode(trim($_GET['encode'])));//对search.php产生的随机编码URL进行固定解码...
$action = $action['intro'];
if($action == 'best[L]'){//热卖类内页 如:search.php?intro=best 得到best
$keywords = " ";//这里就是您的关键词
$description = " ";//这里是您的描述
}
}
elseif ('flow' == $filename)//获取当前页的地址参数...如:flow.php 得到flow
{
$keywords = "flow";//这里就是您的关键词
$description = "flow";//这里是您的描述
}
elseif ('message' == $filename)//获取当前页的地址参数...如:message.php 得到message
{
$keywords = "message";//这里就是您的关键词
$description = "message";//这里是您的描述
}
return array('title' => $page_title, 'ur_here' => $ur_here,
'keywords'=> $keywords,'description' => $description);
基本上的功能已经实现,你可以在需要参数的代码中增加:
$smarty->assign('keywords', $position['keywords']); //页面关键词
$smarty->assign('description',$position['description']); // 页面描述
长见识了
多谢分享,或许将来会用上,,欢迎回访主宰者博客www.myzhuzaizhe.com
ecshop没怎么用过,用得最多的是php,ecshop 的产品内容页 seo 都可以通过后台进行单独的设置,这个还真没有折腾过
懂代码就是快
普及了知识
博主对于ECSHOP都已经用得非常熟练了啊,随心所欲修改或新增功能,厉害