Friday Nov 10, 2006

More about Tag Clouds on roller

Another e-mail exchange with Dave Johnson, and a quick look at the Velocity manual and I have produced the tag cloud at the top of this page which only includes those tags, with more than two occurences.

I set an interest threshold, and then within the foreach tag loop test the tag count against the interest theshold.

  #set ( $interestthreshold=2 )
  #set($mytags=$model.weblog.getPopularTags(-1, 100))
  #foreach ($tag in $mytags)
      #if ( $tag.count > $interestthreshold )
        <A CLASS="tag s${tag.intensity}" HREF="$url.tag($tag.name)"
           TITLE="$tag.count"> $tag.name</A>
      #end
  #end

The tag is only written if tag count is greater than the threshold.

tags:

About

DaveLevy

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today