| 1 | Tagwire Plugin |
|---|
| 2 | $Id$ |
|---|
| 3 | |
|---|
| 4 | A plugin for handling entries' keywords as "tag" in Movable Type. |
|---|
| 5 | |
|---|
| 6 | =========== |
|---|
| 7 | DESCRIPTION |
|---|
| 8 | =========== |
|---|
| 9 | |
|---|
| 10 | Tagwire Plugin(aka AllKeywords Plugin) provides an easier way to |
|---|
| 11 | handling "tags" in Movable Type. The keywords fields of any entries |
|---|
| 12 | are used as "tags". |
|---|
| 13 | |
|---|
| 14 | Unlike Tags and Tagslite Plugin, this plugin has the following |
|---|
| 15 | features: |
|---|
| 16 | |
|---|
| 17 | - Multilingual Tagging: |
|---|
| 18 | |
|---|
| 19 | - Flexible Tag Format: |
|---|
| 20 | |
|---|
| 21 | - MT's categories are Untaint: Tagwire Plugin uses only "keywords" |
|---|
| 22 | field of entries, so users can use "categories" just as themselves |
|---|
| 23 | separately. |
|---|
| 24 | |
|---|
| 25 | - Full-fledged support for tag handling: Tagwire provides various |
|---|
| 26 | functions including blog-wide/entry-wise tag listing and counting, |
|---|
| 27 | listing entries that have user-specified tags, and listing related |
|---|
| 28 | entries. |
|---|
| 29 | |
|---|
| 30 | - Moderate Rebuilding Time: Tagwire realizes tag indexing without |
|---|
| 31 | support of your DB engines. It often leads to performance |
|---|
| 32 | degradation especially for rebuilding, but Tagwire employs |
|---|
| 33 | PluginData and Request Cache effectively and achieves enough speed. |
|---|
| 34 | |
|---|
| 35 | - Dynamic Tag Archiving coupled with MT-XSearch: Though Tagwire |
|---|
| 36 | generates no static tag archives, it couples with Tim Appnel's |
|---|
| 37 | MT-XSearch and supports Dynamic Tag Archiving. |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | ============ |
|---|
| 41 | INSTALLATION |
|---|
| 42 | ============ |
|---|
| 43 | |
|---|
| 44 | To install this plugin, upload or copy 'tagwire.pl' into your Movable |
|---|
| 45 | Type's plugin directory. |
|---|
| 46 | |
|---|
| 47 | After proper installation, you will see a new "Tagwire Plugin" listed |
|---|
| 48 | on the Main Menu of your Movable Type. |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | ========== |
|---|
| 52 | TAG FORMAT |
|---|
| 53 | ========== |
|---|
| 54 | |
|---|
| 55 | Tagwire automatically interprets the string which inputs the keywords |
|---|
| 56 | field of the entry, as "tags". Any strings enclosed by brackets([,]), |
|---|
| 57 | sigle and double quotes are parsed as a single tag. And any strings |
|---|
| 58 | separated by delimiter characters(;,|) are parsed as a single tag. |
|---|
| 59 | And if no delimiter characters appear, whitespaces work as delimter. |
|---|
| 60 | |
|---|
| 61 | The following all examples are recognized as two tags "Movable Type" |
|---|
| 62 | and "Plugin": |
|---|
| 63 | |
|---|
| 64 | "Movable Type" Plugin |
|---|
| 65 | Movable Type, Plugin |
|---|
| 66 | Movable Type|Plugin| |
|---|
| 67 | [Movable Type][Plugin] |
|---|
| 68 | |
|---|
| 69 | And the following example is parsed as two tags "MT" and "Plugin": |
|---|
| 70 | |
|---|
| 71 | MT Plugin |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | ==== |
|---|
| 75 | TAGS |
|---|
| 76 | ==== |
|---|
| 77 | |
|---|
| 78 | From here I will explain MT container/varable tags introduced by |
|---|
| 79 | Tagwire Plugin. |
|---|
| 80 | |
|---|
| 81 | ---------------- |
|---|
| 82 | MTTags Container |
|---|
| 83 | ---------------- |
|---|
| 84 | |
|---|
| 85 | A container tag for listing all available "tags" for the current blog. |
|---|
| 86 | |
|---|
| 87 | * Option(s): |
|---|
| 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 | |
|---|
| 95 | sort_by="tag|tag-case|count" |
|---|
| 96 | |
|---|
| 97 | Chooses sorting method for tags. "tag" means case-insensitive |
|---|
| 98 | alphabetical sort, "tag-case" means case-sensitive alphabetical |
|---|
| 99 | sort, "count" means sort by tag's count. Default setting is "tag". |
|---|
| 100 | |
|---|
| 101 | sort_order="ascend|descend" |
|---|
| 102 | |
|---|
| 103 | Chooses sorting order. The default sort_order is "ascend". |
|---|
| 104 | |
|---|
| 105 | lastn="N" |
|---|
| 106 | |
|---|
| 107 | Shows only last N tags. By default, all tags are displayed. |
|---|
| 108 | |
|---|
| 109 | case_sensitive="0|1" |
|---|
| 110 | |
|---|
| 111 | Chooses whether the plugin treats tags as the case-sensitive |
|---|
| 112 | manner or not. In the case-sensitive manner, the plugin |
|---|
| 113 | recognizes "Apple" and "appLE" as two different tags, on the other |
|---|
| 114 | hand, it recognizes them as a same tag in the case-insensitive |
|---|
| 115 | manner. The default is case_sensitive="1". |
|---|
| 116 | |
|---|
| 117 | * Available tags in this container: |
|---|
| 118 | |
|---|
| 119 | <$MTTag$> |
|---|
| 120 | Shows the tag. |
|---|
| 121 | |
|---|
| 122 | <$MTTagCount$> |
|---|
| 123 | Shows the appearance count of the tag. |
|---|
| 124 | |
|---|
| 125 | <$MTTagDate$> |
|---|
| 126 | Shows the last date the tag added. |
|---|
| 127 | |
|---|
| 128 | <$MTTagsTotal$> |
|---|
| 129 | Shows the number of all tags. |
|---|
| 130 | |
|---|
| 131 | <$MTTagsTotalSum$> |
|---|
| 132 | Shows the total appearance count of all tags. |
|---|
| 133 | |
|---|
| 134 | * Example: |
|---|
| 135 | |
|---|
| 136 | To list 10 most appeared tags and link them to Technorati: |
|---|
| 137 | |
|---|
| 138 | <ul> |
|---|
| 139 | <MTTags sort_by="count" sort_order="descend" lastn="10"> |
|---|
| 140 | <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" |
|---|
| 141 | rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a> (<$MTTagCount$>)</li> |
|---|
| 142 | </MTTags> |
|---|
| 143 | </ul> |
|---|
| 144 | <ul> |
|---|
| 145 | <li>Total Tags: <$MTTagsTotal$></li> |
|---|
| 146 | <li>Total Tags(Sum): <$MTTagsTotalSum$></li> |
|---|
| 147 | </ul> |
|---|
| 148 | |
|---|
| 149 | And Ogawa::Memoranda Tags(http://as-is.net/blog/tags.html) is an |
|---|
| 150 | example of using MTTags container. |
|---|
| 151 | |
|---|
| 152 | --------------------- |
|---|
| 153 | MTEntryTags Container |
|---|
| 154 | --------------------- |
|---|
| 155 | |
|---|
| 156 | A container tag for listing tags for an entry. It can only be used in |
|---|
| 157 | "entry context" which means "the inside of MTEntries" or Individual |
|---|
| 158 | Archives. |
|---|
| 159 | |
|---|
| 160 | * Option(s): |
|---|
| 161 | |
|---|
| 162 | glue="glue" |
|---|
| 163 | |
|---|
| 164 | Separates each of the tags with a string specified by "glue". |
|---|
| 165 | This is useful when you wish to separate the tag names with a |
|---|
| 166 | comma, for example. |
|---|
| 167 | |
|---|
| 168 | case_sensitive="0|1" |
|---|
| 169 | |
|---|
| 170 | Chooses whether the plugin treats tags as the case-sensitive |
|---|
| 171 | manner or not. The default is case_sensitive="1". |
|---|
| 172 | |
|---|
| 173 | * Available tags in this container: |
|---|
| 174 | |
|---|
| 175 | <$MTTag$> |
|---|
| 176 | Shows the tag. |
|---|
| 177 | |
|---|
| 178 | * Example: |
|---|
| 179 | |
|---|
| 180 | To list tags of the entries and link them to Technorati: |
|---|
| 181 | |
|---|
| 182 | <MTEntries lastn="10"> |
|---|
| 183 | <h2><$MTEntryTitle$></h2> |
|---|
| 184 | |
|---|
| 185 | <ul> |
|---|
| 186 | <MTEntryTags> |
|---|
| 187 | <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" |
|---|
| 188 | rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li> |
|---|
| 189 | </MTEntryTags> |
|---|
| 190 | </ul> |
|---|
| 191 | |
|---|
| 192 | <$MTEntryBody$> |
|---|
| 193 | </MTEntries> |
|---|
| 194 | |
|---|
| 195 | ----------------------- |
|---|
| 196 | MTRelatedTags Container |
|---|
| 197 | ----------------------- |
|---|
| 198 | |
|---|
| 199 | A container tag for listing tags *related* to the current tag. The |
|---|
| 200 | relationship between tags is defined by how many common *entries* |
|---|
| 201 | includes them. This container can only be used in "tag context" which |
|---|
| 202 | means the inside of MTTags, MTEntryTags, or MTXSearchTags. |
|---|
| 203 | |
|---|
| 204 | * Option(s): |
|---|
| 205 | |
|---|
| 206 | glue="glue" |
|---|
| 207 | |
|---|
| 208 | Separates each of the tags with a string specified by "glue". |
|---|
| 209 | This is useful when you wish to separate the tag names with a |
|---|
| 210 | comma, for example. |
|---|
| 211 | |
|---|
| 212 | sort_by="tag|tag-case|count" |
|---|
| 213 | |
|---|
| 214 | Chooses sorting method for tags. "tag" means case-insensitive |
|---|
| 215 | alphabetical sort, "tag-case" means case-sensitive alphabetical |
|---|
| 216 | sort, "count" means sort by tag's count. Default setting is "tag". |
|---|
| 217 | |
|---|
| 218 | sort_order="ascend|descend" |
|---|
| 219 | |
|---|
| 220 | Chooses sorting order. The default sort_order is "ascend". |
|---|
| 221 | |
|---|
| 222 | lastn="N" |
|---|
| 223 | |
|---|
| 224 | Shows only last N tags. By default, all tags are displayed. |
|---|
| 225 | |
|---|
| 226 | case_sensitive="0|1" |
|---|
| 227 | |
|---|
| 228 | Chooses whether the plugin treats tags as the case-sensitive |
|---|
| 229 | manner or not. The default is case_sensitive="1". |
|---|
| 230 | |
|---|
| 231 | * Available tags in this container: |
|---|
| 232 | |
|---|
| 233 | <$MTTag$> |
|---|
| 234 | Shows the tag. |
|---|
| 235 | |
|---|
| 236 | <$MTTagCount$> |
|---|
| 237 | Shows the appearance count of the tag. |
|---|
| 238 | |
|---|
| 239 | <$MTTagDate$> |
|---|
| 240 | Shows the last date the tag added. |
|---|
| 241 | |
|---|
| 242 | * Example: |
|---|
| 243 | |
|---|
| 244 | To list tags of the entries and their related tags, and to link all of them to Technorati: |
|---|
| 245 | |
|---|
| 246 | <MTEntries lastn="10"> |
|---|
| 247 | <h2><$MTEntryTitle$></h2> |
|---|
| 248 | |
|---|
| 249 | <ul> |
|---|
| 250 | <MTEntryTags> |
|---|
| 251 | <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" |
|---|
| 252 | rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a> |
|---|
| 253 | <ul> |
|---|
| 254 | <MTRelatedTags> |
|---|
| 255 | <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" |
|---|
| 256 | rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li> |
|---|
| 257 | </MTRelatedTags> |
|---|
| 258 | </ul> |
|---|
| 259 | </li> |
|---|
| 260 | </MTEntryTags> |
|---|
| 261 | </ul> |
|---|
| 262 | |
|---|
| 263 | <$MTEntryBody$> |
|---|
| 264 | </MTEntries> |
|---|
| 265 | |
|---|
| 266 | --------------------------- |
|---|
| 267 | MTEntriesWithTags Container |
|---|
| 268 | --------------------------- |
|---|
| 269 | |
|---|
| 270 | A container tag for listing entries which have user-specified tags. |
|---|
| 271 | |
|---|
| 272 | * Option(s): |
|---|
| 273 | |
|---|
| 274 | tags="tag-list" |
|---|
| 275 | |
|---|
| 276 | User-specified tags for listing. It can be a single tag or |
|---|
| 277 | multiple tags separated by a delimiter. |
|---|
| 278 | |
|---|
| 279 | delimiter="delim" |
|---|
| 280 | |
|---|
| 281 | Sets the delimiter character for the abovementioned "tags" option. |
|---|
| 282 | The default delimiter is whitespaces. |
|---|
| 283 | |
|---|
| 284 | case_sensitive="0|1" |
|---|
| 285 | |
|---|
| 286 | Chooses whether the plugin treats tags as the case-sensitive |
|---|
| 287 | manner or not. The default is case_sensitive="1". |
|---|
| 288 | |
|---|
| 289 | sort_order="ascend|descend" |
|---|
| 290 | |
|---|
| 291 | Chooses sorting order. The default sort_order is "descend". |
|---|
| 292 | |
|---|
| 293 | lastn="N" |
|---|
| 294 | |
|---|
| 295 | Shows only last N entries. By default, all entries including |
|---|
| 296 | user-specified tags are displayed. |
|---|
| 297 | |
|---|
| 298 | * Available tags in this container: |
|---|
| 299 | |
|---|
| 300 | As like MTEntries container, various tags including MTEntry* are |
|---|
| 301 | available inside this container. |
|---|
| 302 | |
|---|
| 303 | * Example: |
|---|
| 304 | |
|---|
| 305 | To list all entries which have "movable" and "type" tag: |
|---|
| 306 | |
|---|
| 307 | <MTEntriesWithTags tags="movable type"> |
|---|
| 308 | <h2><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h2> |
|---|
| 309 | |
|---|
| 310 | <$MTEntryBody$> |
|---|
| 311 | <$MTEntryExtended$> |
|---|
| 312 | </MTEntriesWithTags> |
|---|
| 313 | |
|---|
| 314 | ------------------------------ |
|---|
| 315 | MTMostRelatedEntries Container |
|---|
| 316 | ------------------------------ |
|---|
| 317 | |
|---|
| 318 | A container tag for listing entries *related* to the current entry. |
|---|
| 319 | The relationship between entries is defined by how many common *tags* |
|---|
| 320 | they have. This container can only be used in "entry context" which |
|---|
| 321 | means "the inside of MTEntries" or Individual Archives. |
|---|
| 322 | |
|---|
| 323 | * Option(s): |
|---|
| 324 | |
|---|
| 325 | case_sensitive="0|1" |
|---|
| 326 | |
|---|
| 327 | Chooses whether the plugin treats tags as the case-sensitive |
|---|
| 328 | manner or not. The default is case_sensitive="1". |
|---|
| 329 | |
|---|
| 330 | sort_order="ascend|descend" |
|---|
| 331 | |
|---|
| 332 | Chooses sorting order. The default sort_order is "descend". |
|---|
| 333 | |
|---|
| 334 | lastn="N" |
|---|
| 335 | |
|---|
| 336 | Shows only N most related entries. By default, all related entries |
|---|
| 337 | are displayed. |
|---|
| 338 | |
|---|
| 339 | * Available tags in this container: |
|---|
| 340 | |
|---|
| 341 | As like MTEntries container, various tags including MTEntry* are |
|---|
| 342 | available inside this container. |
|---|
| 343 | |
|---|
| 344 | * Example: |
|---|
| 345 | |
|---|
| 346 | To list 10 most related entries for the current entry: |
|---|
| 347 | |
|---|
| 348 | <MTEntries> |
|---|
| 349 | <h2><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h2> |
|---|
| 350 | <$MTEntryBody$> |
|---|
| 351 | |
|---|
| 352 | <ul> |
|---|
| 353 | <MTMostRelatedEntries lastn="10"> |
|---|
| 354 | <li><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></li> |
|---|
| 355 | </MTMostRelatedEntries> |
|---|
| 356 | </ul> |
|---|
| 357 | </MTEntries> |
|---|
| 358 | |
|---|
| 359 | ----------------------- |
|---|
| 360 | MTXSearchTags Container |
|---|
| 361 | ----------------------- |
|---|
| 362 | |
|---|
| 363 | A container tag for listing the query string of MT-XSearch as tags. |
|---|
| 364 | It can only be used in "MT-XSearch" Template. |
|---|
| 365 | |
|---|
| 366 | * Option(s): |
|---|
| 367 | |
|---|
| 368 | glue="glue" |
|---|
| 369 | |
|---|
| 370 | Separates each of the tags with a string specified by "glue". |
|---|
| 371 | This is useful when you wish to separate the tag names with a |
|---|
| 372 | comma, for example. |
|---|
| 373 | |
|---|
| 374 | * Available tags in this container: |
|---|
| 375 | |
|---|
| 376 | <$MTTag$> |
|---|
| 377 | Shows the tag. |
|---|
| 378 | |
|---|
| 379 | * Example: |
|---|
| 380 | |
|---|
| 381 | To list tags given by the query string of MT-XSearch and their related tags, and to link them to Technorati: |
|---|
| 382 | |
|---|
| 383 | <MTXSearchTags> |
|---|
| 384 | <h2><$MTTag$></h2> |
|---|
| 385 | |
|---|
| 386 | <ul> |
|---|
| 387 | <MTRelatedTags> |
|---|
| 388 | <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" |
|---|
| 389 | rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li> |
|---|
| 390 | </MTRelatedTags> |
|---|
| 391 | </ul> |
|---|
| 392 | </MTXSearchTags> |
|---|
| 393 | |
|---|
| 394 | --------------------- |
|---|
| 395 | encode_urlplus Filter |
|---|
| 396 | --------------------- |
|---|
| 397 | |
|---|
| 398 | A variation of encode_url filter. First this filter converts |
|---|
| 399 | whitespaces of the target string into '+'s, and then converts it into |
|---|
| 400 | URL-safe string. |
|---|
| 401 | |
|---|
| 402 | * Example: |
|---|
| 403 | |
|---|
| 404 | <ul> |
|---|
| 405 | <MTEntryTags> |
|---|
| 406 | <li><a href="http://www.technorati.com/tag/<$MTTag encode_urlplus="1"$>" |
|---|
| 407 | rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li> |
|---|
| 408 | </MTEntryTags> |
|---|
| 409 | </ul> |
|---|
| 410 | |
|---|
| 411 | |
|---|
| 412 | ======== |
|---|
| 413 | SEE ALSO |
|---|
| 414 | ======== |
|---|
| 415 | |
|---|
| 416 | Lastest version of this document will be found: |
|---|
| 417 | http://as-is.net/hacks/2005/06/tagwire_plugin.html |
|---|
| 418 | |
|---|
| 419 | Advanced documents and Japanese documents are also available from the |
|---|
| 420 | above URL. |
|---|
| 421 | |
|---|
| 422 | |
|---|
| 423 | ======= |
|---|
| 424 | LICENSE |
|---|
| 425 | ======= |
|---|
| 426 | |
|---|
| 427 | This code is released under the Artistic License. The terms of the |
|---|
| 428 | Artistic License will be found: |
|---|
| 429 | http://www.opensource.org/licenses/artistic-license.php |
|---|
| 430 | |
|---|
| 431 | |
|---|
| 432 | ================== |
|---|
| 433 | AUTHOR & COPYRIGHT |
|---|
| 434 | ================== |
|---|
| 435 | |
|---|
| 436 | Copyright 2005, Hirotaka Ogawa (hirotaka.ogawa@gmail.com) |
|---|