| 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 a tag. |
|---|
| 121 | |
|---|
| 122 | <$MTTagCount$> |
|---|
| 123 | Shows the appearance count of a tag. |
|---|
| 124 | |
|---|
| 125 | <$MTTagsTotal$> |
|---|
| 126 | Shows the count of all tags. |
|---|
| 127 | |
|---|
| 128 | <$MTTagsTotalSum$> |
|---|
| 129 | Shows the total appearance count of all tags. |
|---|
| 130 | |
|---|
| 131 | * Example: |
|---|
| 132 | |
|---|
| 133 | To list 10 most appeared tags and link them to Technorati: |
|---|
| 134 | |
|---|
| 135 | <ul> |
|---|
| 136 | <MTTags sort_by="count" sort_order="descend" lastn="10"> |
|---|
| 137 | <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" |
|---|
| 138 | rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a> (<$MTTagCount$>)</li> |
|---|
| 139 | </MTTags> |
|---|
| 140 | </ul> |
|---|
| 141 | <ul> |
|---|
| 142 | <li>Total Tags: <$MTTagsTotal$></li> |
|---|
| 143 | <li>Total Tags(Sum): <$MTTagsTotalSum$></li> |
|---|
| 144 | </ul> |
|---|
| 145 | |
|---|
| 146 | And Ogawa::Memoranda Tags(http://as-is.net/blog/tags.html) is an |
|---|
| 147 | example of using MTTags container. |
|---|
| 148 | |
|---|
| 149 | --------------------- |
|---|
| 150 | MTEntryTags Container |
|---|
| 151 | --------------------- |
|---|
| 152 | |
|---|
| 153 | A container tag for listing tags for a entry. It can only be used in |
|---|
| 154 | "entry context" which means "the inside of MTEntries" or Individual |
|---|
| 155 | Archives. |
|---|
| 156 | |
|---|
| 157 | * Option(s): |
|---|
| 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 | |
|---|
| 165 | case_sensitive="0|1" |
|---|
| 166 | |
|---|
| 167 | Chooses whether the plugin treats tags as the case-sensitive |
|---|
| 168 | manner or not. The default is case_sensitive="1". |
|---|
| 169 | |
|---|
| 170 | * Available tags in this container: |
|---|
| 171 | |
|---|
| 172 | Available tags are same as MTTags. |
|---|
| 173 | |
|---|
| 174 | * Example: |
|---|
| 175 | |
|---|
| 176 | To list tags of the entries and link them to Technorati: |
|---|
| 177 | |
|---|
| 178 | <MTEntries lastn="10"> |
|---|
| 179 | <h2><$MTEntryTitle$></h2> |
|---|
| 180 | |
|---|
| 181 | <ul> |
|---|
| 182 | <MTEntryTags> |
|---|
| 183 | <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" |
|---|
| 184 | rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li> |
|---|
| 185 | </MTEntryTags> |
|---|
| 186 | </ul> |
|---|
| 187 | |
|---|
| 188 | <$MTEntryBody$> |
|---|
| 189 | </MTEntries> |
|---|
| 190 | |
|---|
| 191 | --------------------------- |
|---|
| 192 | MTEntriesWithTags Container |
|---|
| 193 | --------------------------- |
|---|
| 194 | |
|---|
| 195 | A container tag for listing entries which have user-specified tags. |
|---|
| 196 | |
|---|
| 197 | * Option(s): |
|---|
| 198 | |
|---|
| 199 | tags="tag-list" |
|---|
| 200 | |
|---|
| 201 | User-specified tags for listing. It can be a single tag or |
|---|
| 202 | multiple tags separated by a delimiter. |
|---|
| 203 | |
|---|
| 204 | delimiter="delim" |
|---|
| 205 | |
|---|
| 206 | Sets the delimiter character for the abovementioned "tags" option. |
|---|
| 207 | The default delimiter is whitespaces. |
|---|
| 208 | |
|---|
| 209 | case_sensitive="0|1" |
|---|
| 210 | |
|---|
| 211 | Chooses whether the plugin treats tags as the case-sensitive |
|---|
| 212 | manner or not. The default is case_sensitive="1". |
|---|
| 213 | |
|---|
| 214 | sort_order="ascend|descend" |
|---|
| 215 | |
|---|
| 216 | Chooses sorting order. The default sort_order is "descend". |
|---|
| 217 | |
|---|
| 218 | lastn="N" |
|---|
| 219 | |
|---|
| 220 | Shows only last N entries. By default, all entries including |
|---|
| 221 | user-specified tags are displayed. |
|---|
| 222 | |
|---|
| 223 | * Available tags in this container: |
|---|
| 224 | |
|---|
| 225 | As like MTEntries container, various tags including MTEntry* are |
|---|
| 226 | available inside this container. |
|---|
| 227 | |
|---|
| 228 | * Example: |
|---|
| 229 | |
|---|
| 230 | To list all entries which have "movable" and "type" tag: |
|---|
| 231 | |
|---|
| 232 | <MTEntriesWithTags tags="movable type"> |
|---|
| 233 | <h2><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h2> |
|---|
| 234 | |
|---|
| 235 | <$MTEntryBody$> |
|---|
| 236 | <$MTEntryExtended$> |
|---|
| 237 | </MTEntriesWithTags> |
|---|
| 238 | |
|---|
| 239 | ------------------------------ |
|---|
| 240 | MTMostRelatedEntries Container |
|---|
| 241 | ------------------------------ |
|---|
| 242 | |
|---|
| 243 | A container tag for listing entries *related* to the current entry. |
|---|
| 244 | The relationship between entries is defined by how many common *tags* |
|---|
| 245 | they have. This container can only be used in "entry context" which |
|---|
| 246 | means "the inside of MTEntries" or Individual Archives. |
|---|
| 247 | |
|---|
| 248 | * Option(s): |
|---|
| 249 | |
|---|
| 250 | case_sensitive="0|1" |
|---|
| 251 | |
|---|
| 252 | Chooses whether the plugin treats tags as the case-sensitive |
|---|
| 253 | manner or not. The default is case_sensitive="1". |
|---|
| 254 | |
|---|
| 255 | sort_order="ascend|descend" |
|---|
| 256 | |
|---|
| 257 | Chooses sorting order. The default sort_order is "descend". |
|---|
| 258 | |
|---|
| 259 | lastn="N" |
|---|
| 260 | |
|---|
| 261 | Shows only N most related entries. By default, all related entries |
|---|
| 262 | are displayed. |
|---|
| 263 | |
|---|
| 264 | * Available tags in this container: |
|---|
| 265 | |
|---|
| 266 | As like MTEntries container, various tags including MTEntry* are |
|---|
| 267 | available inside this container. |
|---|
| 268 | |
|---|
| 269 | * Example: |
|---|
| 270 | |
|---|
| 271 | To list 10 most related entries for the current entry: |
|---|
| 272 | |
|---|
| 273 | <MTEntries> |
|---|
| 274 | <h2><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h2> |
|---|
| 275 | <$MTEntryBody$> |
|---|
| 276 | |
|---|
| 277 | <ul> |
|---|
| 278 | <MTMostRelatedEntries lastn="10"> |
|---|
| 279 | <li><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></li> |
|---|
| 280 | </MTMostRelatedEntries> |
|---|
| 281 | </ul> |
|---|
| 282 | </MTEntries> |
|---|
| 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 | |
|---|
| 301 | |
|---|
| 302 | ======== |
|---|
| 303 | SEE ALSO |
|---|
| 304 | ======== |
|---|
| 305 | |
|---|
| 306 | Lastest version of this document will be found: |
|---|
| 307 | http://as-is.net/hacks/2005/06/tagwire_plugin.html |
|---|
| 308 | |
|---|
| 309 | Advanced documents and Japanese documents are also available from the |
|---|
| 310 | above URL. |
|---|
| 311 | |
|---|
| 312 | |
|---|
| 313 | ======= |
|---|
| 314 | LICENSE |
|---|
| 315 | ======= |
|---|
| 316 | |
|---|
| 317 | This code is released under the Artistic License. The terms of the |
|---|
| 318 | Artistic License will be found: |
|---|
| 319 | http://www.opensource.org/licenses/artistic-license.php |
|---|
| 320 | |
|---|
| 321 | |
|---|
| 322 | ================== |
|---|
| 323 | AUTHOR & COPYRIGHT |
|---|
| 324 | ================== |
|---|
| 325 | |
|---|
| 326 | Copyright 2005, Hirotaka Ogawa (hirotaka.ogawa@gmail.com) |
|---|