大菠萝

大菠萝(Diablo)乃暗黑之王

修改tag显示,利于Google收录

今天发现Google不收录俺的文章,只收录tag页面。页面在tag页面里是全文输出,而tag的链接又比较短,Google就只收录Tag,不收录真正的页面文件了。

解决办法:在tag页面只显示文章标题和描述。

解决:修改User controls\PostList.ascx.cs BindPosts()方法加入如下代码

bool oo;
if (Request["tag"] != null)
{ oo = true; }
else
{ oo = BlogSettings.Instance.ShowDescriptionInPostList; }

然后将postView.ShowExcerpt = Instance.ShowDescriptionInPostList修改为postView.ShowExcerpt = oo即可实现在tag页面只显示文章标题和描述。修改后效果可以参考香雪兰

你也可以直接下载我修改后的文件覆盖到User controls\目录即可。猛击下载PostList.ascx.zip

Tags:|||

by benben 5/29/2008 5:40:18 PM 固定连接 | Comments(2)| 程序设计

Comments

沈胜衣 6/8/2008 1:41:39 PM

postView.ShowExcerpt = Request["tag"] != null||Instance.ShowDescriptionInPostList;
岂不更加直接

benben 6/8/2008 5:52:25 PM

@沈胜衣 谢谢分享。


留言





如果留言不成功请联系ben#119797.com