复制本文网址 | 上一篇 | 下一篇 | 返回日志列表

给zblog的tag页面标签排队

从昨天晚上折腾到今天,无论修改tags.asp还是模板里的tags.html还是b_article_tag.html,都无法给每个标签加上width;论坛发帖也没解答;忍无可忍下又去找巴士飞扬,总算得以解决。

修改方法:修改根目录下的tags.asp,找到下面这段,

Dim Tag
Dim strTagCloud
For Each Tag in Tags

 

 If IsObject(Tag) Then

   strTagCloud=strTagCloud & "<span style='font-family:verdana,sans-serif;line-height:150%;font-size:"& 12 + (Tag.Count/2) &"px;margin:10px;'><a title='" & Tag.Count & "' alt='"&  Tag.Count  &"' href='" & Tag.Url &"'>" & Tag.name & "</a></span>"

 End If
Next

替换成:

Dim Tag
Dim strTagCloud
strTagCloud="<table width=100% border=0 cellpadding=0 cellspacing=0>"
dim i
i=0
dim rowcount
rowcount=4
For Each Tag in Tags
 If IsObject(Tag) Then
  if i=0 then
   strTagCloud=strTagCloud &"<tr height='22'>"
  end if
   strTagCloud=strTagCloud & "<td height='20'><span style='line-height:15px;'><a title='" & Tag.Intro & "' alt='"&  Tag.Count  &"' href='" & Tag.Url &"'>" & Tag.name & "-" & Tag.Count & "篇</a></span></td>"
  if i=(rowcount-1) then
   strTagCloud=strTagCloud &"</tr>"
  end if
  i=(i+1) mod rowcount
 End If 
Next
if i<>0 then
 strTagCloud=strTagCloud & "<td colspan=""" & rowcount-i & """>&nbsp;</td></tr>"
end if
strTagCloud=strTagCloud &"</table>"

其中rowcount=4表示有多少列,可以按自己的皮肤需求定,td和tr的height高度可以按自己需求调整——这里我为了对其皮肤的背景横线,对的好辛苦 T.T。title='" & Tag.Intro & "'为鼠标放到tag上的效果,默认的是标签所包含的文章数,这里设置成了标签摘要。当然,摘要在在后台编辑标签写上才会有。而至于标签数还是移出来直接显示了。效果可见:http://yyld.net/blog/tags.asp

  • 2007-11-2 15:35:53  Z-Blog   
评论列表
共3篇评论
  • 1楼   巴士飞扬  http://www.busfly.cn   02/11/2007 16:06:10 (距发表1小时后)   
  • 看到灵丹特意提示是我帮的忙,心里扎根的高兴,总算不是徒劳,还给我链接了个.
    不过,我还是想要首页链接,给我PR值带点好处,哈哈,可惜,灵丹就是不肯,只好做白日梦了.不知道有没有天鹅飞过.......
  • 2楼   haphic  http://haphic.com/   03/11/2007 09:50:00 (距发表18小时后)   
  • 嗯...失去 Cloud 的意境了...妨仅把原来的 Tag.asp 中的 span 换成 p 或 div 然后把它的样式设为 float:left; 好像这样处理还不完善, 对 IE 还要加一句不要换行或者什么的.
  • 3楼   星铃丹    03/11/2007 15:44:13 (距发表24小时后)   
  • 以haphic的补充haphic的:如果要保持标签样式但不想标签自动换行的话,就在span后面加个display:inline;即可。float:left;不用加,效果并不好。

发表评论

☆温馨提示:为防spam,评论禁止了网址相关内容,如想发自己的网站,请往网址专用输入框里放 ^_^

Powered By Z-Blog | YYNote Design By 星铃丹 | 摇曳铃丹 版权所有 YYLD.net