Changeset 97
- Timestamp:
- 06/25/05 01:08:54 (3 years ago)
- Files:
-
- tagwire/trunk/README.txt (modified) (5 diffs)
- tagwire/trunk/tagwire.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tagwire/trunk/README.txt
r95 r97 23 23 separately. 24 24 25 - Full-fle ged support for tag handling: Tagwire provides various26 functions including blog-wide/entry-wise tag listing and cou ting,25 - Full-fledged support for tag handling: Tagwire provides various 26 functions including blog-wide/entry-wise tag listing and counting, 27 27 listing entries that have user-specified tags, and listing related 28 28 entries. … … 87 87 * Option(s): 88 88 89 glue="glue" 90 91 Separates each of the tags with a string specified by "glue". 92 This is useful when you wish to separate the tag names with a 93 comma, for example. 94 89 95 sort_by="tag|tag-case|count" 90 96 … … 151 157 * Option(s): 152 158 159 glue="glue" 160 161 Separates each of the tags with a string specified by "glue". 162 This is useful when you wish to separate the tag names with a 163 comma, for example. 164 153 165 case_sensitive="0|1" 154 166 … … 168 180 169 181 <ul> 170 <MT Tags sort_by="count" sort_order="descend" lastn="10">182 <MTEntryTags> 171 183 <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" 172 184 rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li> 173 </MT Tags>185 </MTEntryTags> 174 186 </ul> 175 187 … … 270 282 </MTEntries> 271 283 284 --------------------- 285 encode_urlplus Filter 286 --------------------- 287 288 A variation of encode_url filter. First this filter converts 289 whitespaces of the target string into '+'s, and then converts it into 290 URL-safe string. 291 292 * Example: 293 294 <ul> 295 <MTEntryTags> 296 <li><a href="http://www.technorati.com/tag/<$MTTag encode_urlplus="1"$>" 297 rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li> 298 </MTEntryTags> 299 </ul> 300 272 301 273 302 ============================= tagwire/trunk/tagwire.pl
r95 r97 90 90 MT::Template::Context->add_container_tag('EntriesWithTags' => \&entries); 91 91 MT::Template::Context->add_container_tag('MostRelatedEntries' => \&most_related_entries); 92 MT::Template::Context->add_global_filter('encode_urlplus' => \&encode_urlplus); 92 93 93 94 # For compatibility (this plugin was formerly named 'AllKeywords') … … 452 453 } 453 454 455 sub encode_urlplus { 456 my $s = $_[0]; 457 return $s unless $_[1]; 458 require MT::Util; 459 $s =~ tr/ /+/; 460 MT::Util::encode_url($s); 461 } 462 454 463 eval { 455 464 require MT::XSearch;
