Tagwire Plugin
A plugin for handling entries' keywords as "tag" in Movable Type.
- Initial release of AllKeywords Plugin
- Change plugin name to "Tagwire Plugin" and released with English document
- Add encode_urlplus filter and its document
- Minor bug fix.
- Support newer plugin interface of MT3.X?
- Fix for the duplicated PluginData problem when using with SQLite.
- Add MTTagDate for displaying the last date the tag added.
- Add MTRelatedTags for listing tags related to the current tag.
- Add MTXSearchTags for listing tags specified by MT-XSearch's argument.
- Modify README.txt for these changes.
- Add tagwire-pdcleaner.cgi which is a simple tool for cleaning PluginData for tagwire.
- Fix minor bugs.
- More bug fixes.
Tagwire Plugin (aka AllKeywords Plugin) provides an easier way to handling "tags" in Movable Type. The keywords fields of any entries are used as "tags".
Unlike Tags and Tagslite Plugin, this plugin has the following features:
- Multilingual Tagging:
- Flexible Tag Format:
- MT's categories are Untaint:
Tagwire Plugin uses only "keywords" field of entries, so users can use "categories" just as themselves separately. - Full-fledged support for tag handling:
Tagwire provides various functions including blog-wide/entry-wise tag listing and counting, listing entries that have user-specified tags, and listing related entries. - Moderate Rebuilding Time:
Tagwire realizes tag indexing without support of your DB engines. It often leads to performance degradation especially for rebuilding, but Tagwire employs PluginData and Request Cache effectively and achieves enough speed. - Dynamic Tag Archiving coupled with MT-XSearch:
Though Tagwire generates no static tag archives, it couples with Tim Appnel's MT-XSearch and supports Dynamic Tag Archiving.
Installation
To install this plugin, upload or copy 'tagwire.pl' into your Movable Type's plugin directory.
After proper installation, you will see a new "Tagwire Plugin" listed on the Main Menu of your Movable Type.
Tag Format
Tagwire automatically interprets the string which inputs the keywords field of the entry, as "tags". Any strings enclosed by brackets([,]), sigle and double quotes are parsed as a single tag. And any strings separated by delimiter characters(;,|) are parsed as a single tag. And if no delimiter characters appear, whitespaces work as delimter.
The following all examples are recognized as two tags "Movable Type" and "Plugin":
"Movable Type" Plugin Movable Type, Plugin Movable Type|Plugin| [Movable Type][Plugin]
And the following example is parsed as two tags "MT" and "Plugin":
MT Plugin
MTTags Container
A container tag for listing all available "tags" for the current blog.
Option(s):
- glue="glue"
- Separates each of the tags with a string specified by "glue". This is useful when you wish to separate the tag names with a comma, for example.
- sort_by="tag|tag-case|count"
- Chooses sorting method for tags. "tag" means case-insensitive alphabetical sort, "tag-case" means case-sensitive alphabetical sort, "count" means sort by tag's count. Default setting is "tag".
- sort_order="ascend|descend"
- Chooses sorting order. The default sort_order is "ascend".
- lastn="N"
- Shows only last N tags. By default, all tags are displayed.
- case_sensitive="0|1"
- Chooses whether the plugin treats tags as the case-sensitive manner or not. In the case-sensitive manner, the plugin recognizes "Apple" and "appLE" as two different tags, on the other hand, it recognizes them as a same tag in case-insensitive manner. The default is case_sensitive="1".
Available tags in this container:
- <$MTTag$>
- Shows the tag.
- <$MTTagCount$>
- Shows the appearance count of the tag.
- <$MTTagDate$>
- Shows the last date the tag added. As well as MTEntryDate, "format", "language", and "utc" options are avaiable.
- <$MTTagsTotal$>
- Shows the count of all tags.
- <$MTTagsTotalSum$>
- Shows the total appearance count of all tags.
Example:
To list 10 most appeared tags and link them to Technorati:
<ul> <MTTags sort_by="count" sort_order="descend" lastn="10"> <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a> (<$MTTagCount$>)</li> </MTTags> </ul> <ul> <li>Total Tags: <$MTTagsTotal$></li> <li>Total Tags(Sum): <$MTTagsTotalSum$></li> </ul>
And Ogawa::Memoranda Tags is an example of using MTTags container.
MTEntryTags Container
A container tag for listing tags for an entry. It can only be used in "entry context" which means "the inside of MTEntries" or Individual Archives.
Option(s):
- glue="glue"
- Separates each of the tags with a string specified by "glue". This is useful when you wish to separate the tag names with a comma, for example.
- case_sensitive="0|1"
- Chooses whether the plugin treats tags as the case-sensitive manner or not. The default is case_sensitive="1".
Available tags in this container:
- <$MTTag$>
- Shows the tag.
Example:
To list tags of the entries and link them to Technorati:
<MTEntries lastn="10"> <h2><$MTEntryTitle$></h2> <ul> <MTEntryTags> <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li> </MTEntryTags> </ul> <$MTEntryBody$> </MTEntries>
MTRelatedTags Container
A container tag for listing tags *related* to the current tag. The relationship between tags is defined by how many common *entries* includes them. This container can only be used in "tag context" which means the inside of MTTags, MTEntryTags, or MTXSearchTags.
Option(s):
- glue="glue"
- Separates each of the tags with a string specified by "glue". This is useful when you wish to separate the tag names with a comma, for example.
- sort_by="tag|tag-case|count"
- Chooses sorting method for tags. "tag" means case-insensitive alphabetical sort, "tag-case" means case-sensitive alphabetical sort, "count" means sort by tag's count. Default setting is "tag".
- sort_order="ascend|descend"
- Chooses sorting order. The default sort_order is "ascend".
- lastn="N"
- Shows only last N tags. By default, all tags are displayed.
- case_sensitive="0|1"
- Chooses whether the plugin treats tags as the case-sensitive manner or not. The default is case_sensitive="1".
Available tags in this container:
- <$MTTag$>
- Shows the tag.
- <$MTTagCount$>
- Shows the appearance count of the tag.
- <$MTTagDate$>
- Shows the last date the tag added. As well as MTEntryDate, "format", "language", and "utc" options are avaiable for this tag.
Example:
To list tags of the entries and their related tags, and to link all of them to Technorati:
<MTEntries lastn="10">
<h2><$MTEntryTitle$></h2>
<ul>
<MTEntryTags>
<li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>"
rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a>
<ul>
<MTRelatedTags>
<li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>"
rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li>
</MTRelatedTags>
</ul>
</li>
</MTEntryTags>
</ul>
<$MTEntryBody$>
</MTEntries>
MTEntriesWithTags Container
A container tag for listing entries which have user-specified tags.
Option(s):
- tags="tag-list"
- User-specified tags for listing. It can be a single tag or multiple tags separated by a delimiter.
- delimiter="delim"
- Sets the delimiter character for the abovementioned "tags" option. The default delimiter is whitespaces.
- case_sensitive="0|1"
- Chooses whether the plugin treats tags as the case-sensitive manner or not. The default is case_sensitive="1".
- sort_order="ascend|descend"
- Chooses sorting order. The default sort_order is "descend".
- lastn="N"
- Shows only last N entries. By default, all entries including user-specified tags are displayed.
Available tags in this container:
As like MTEntries container, various tags including MTEntry* are available inside this container.
Example:
To list all entries which have "movable" and "type" tag:
<MTEntriesWithTags tags="movable type"> <h2><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h2> <$MTEntryBody$> <$MTEntryExtended$> </MTEntriesWithTags>
MTMostRelatedEntries Container
A container tag for listing entries *related* to the current entry. The relationship between entries is defined by how many common *tags* they have. This container can only be used in "entry context" which means "the inside of MTEntries" or Individual Archives.
Option(s):
- case_sensitive="0|1"
- Chooses whether the plugin treats tags as the case-sensitive manner or not. The default is case_sensitive="1".
- sort_order="ascend|descend"
- Chooses sorting order. The default sort_order is "descend".
- lastn="N"
- Shows only N most related entries. By default, all related entries are displayed.
Available tags in this container:
As like MTEntries container, various tags including MTEntry* are available inside this container.
Example:
To list 10 most related entries for the current entry:
<MTEntries> <h2><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h2> <$MTEntryBody$> <ul> <MTMostRelatedEntries lastn="10"> <li><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></li> </MTMostRelatedEntries> </ul> </MTEntries>
MTXSearchTags Container3>
A container tag for listing the query string of MT-XSearch as tags. It can only be used in "MT-XSearch" Template.
Option(s):
- glue="glue"
- Separates each of the tags with a string specified by "glue". This is useful when you wish to separate the tag names with a comma, for example.
Available tags in this container:
- <$MTTag$>
- Shows the tag.
Example:
To list tags given by the query string of MT-XSearch and their related tags, and to link them to Technorati:
<MTXSearchTags> <h2><$MTTag$></h2> <ul> <MTRelatedTags> <li><a href="http://www.technorati.com/tag/<$MTTag encode_url="1"$>" rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li> </MTRelatedTags> </ul> </MTXSearchTags>encode_urlplus Filter
A variation of encode_url filter. First this filter converts whitespaces of the target string into '+'s, and then converts it into URL-safe string.
Example:
<ul>
<MTEntryTags>
<li><a href="http://www.technorati.com/tag/<$MTTag encode_urlplus="1"$>"
rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a></li>
</MTEntryTags>
</ul>
Contribution
This software is available at no charge. Please consider making a contribution to support our continuous development if possible.
SEE ALSO
Ogawa::Hacks: Dynamic Tag Archiving with Tagwire and MT-XSearch
Japanese document has not been provided yet.
LICENSE
This code is released under the Artistic License. The terms of the Artistic License are described at http://www.perl.com/language/misc/Artistic.html.
AUTHOR & COPYRIGHT
Copyright 2005, Hirotaka Ogawa (hirotaka.ogawa at gmail.com)
Comments
Hello Hirotaka, first I read and try your "allkeyword plugin", now the Tagwire plugin. Today it is a great plugin, because of it's wider flexibility of use. I 'd like to use both, categories AND tags in my blog. I use the "MTEntryShortTitle"-plugin to make short urls. These plugin use square brackets in the keyword-field to separate the short-title. Now my [short-title] produce nonsense-tags.
Is there a solution for use of both - tagwire and short-title?
That would be a wonderful solution.
Thanks! :))
Posted by: Joerg | June 26, 2005 04:43 AM
Hello, Joerg,
It seems Tagwire conflicts with MTEntryShortTitle around bracket([,]) rule. This conflict is unavoidable, so I prepared a special version of Tagwire without bracket rule. Please try this!
http://as-is.net/blog/archives/misc/tagwire-nobracket.zip
For future releases, I will take care this point.
Thanks
Posted by: (o) | June 26, 2005 04:53 PM
Hello Hirotaka, I just think about my personal use of MTShortTitle and Tagwire.
today I only use or for title-generation. MTKeyword-Plugin generates the meta-tag itself. So MTKeyword field is free to use for tagging solution.
[short title] tag1 tag2
if i use tagwire today in my blog, the short title of an entry isn't a real tag for use in technorati or so. I ´ve just tend to think it will be better to generate only the both tag links tag1 and tag2 and blend out the tag "short title" of the MTKeyword field.
what do you think about it?
I don't want to produce nonsense links and
I feel free to choose my short title too.
BTW: Thank you very much for your answer.
Now I get the tags:
- "[short"
- "title]"
- tag1
- tag2
time for me to fall in love with perl?!? :))
Posted by: Joerg | June 26, 2005 05:30 PM
Now it makes sense! For your case, tagwire should ignore "[short title]" pattern. This can be realized by adding just one line (around line 125) to the original.
$string =~ s/\[[^[]+\]//g; # for discarding [short title]
The following file now includes this change:
http://as-is.net/blog/archives/misc/tagwire-nobracket.zip
Posted by: (o) | June 27, 2005 03:05 AM
Thank you for the great plugin. Works fine on my site!
I'd like to include my tags in a custom archive template. How would I construct the URL for each tag? (Configuration > Archiving)
Posted by: Manuela | June 27, 2005 08:02 PM
You mean, you want to generate the filenames of the Individual Archives from their tags?
If so, you can do it as like:
<MTEntryDate format="%Y/%m/%d">/<MTEntryTags glue="_"><MTTag dirify="1"></MTEntryTags>.html
(You can customize date format and "glue" character as you like.)
Posted by: (o) | June 27, 2005 09:37 PM
I want to use category arcives for the tags if that is possible. Something like http://www.mysite.com/tag/.html
Posted by: Manuela | June 27, 2005 10:37 PM
That's not possible, but Tagwire supports dynamic tag archive generation via MT-XSearch. Using this feature, you can do access tag archives like http://www.mysite.com/tag/[tagname].
Sooner or later, I will explain how to do this in this entry or another entry. Please wait for a while.
Posted by: (o) | June 28, 2005 12:47 AM
Thank you for the information!
Posted by: Manuela | June 28, 2005 02:28 AM
Thank you very much for your help. Back home I try your solution and it works great. Think to use it in my blog.
Posted by: Joerg | July 3, 2005 11:09 PM
I have some problems with your plugin.
the rebuild speed goes down and it takes several minutes to post and save an entry.
Can you help me?
Posted by: Joerg | July 9, 2005 02:13 PM
umm, it seems the plugindata broke. I will provide a recovery tool for this. To fix it without a tool, I guess, you can recover it by following these steps:
1. Download the latest version of Tagwire.
2. Edit the plugin file and set $FORCE_PD_REFRESH variable to 1
my $FORCE_PD_REFRESH = 1;
3. And then upload the plugin file, and re-save and rebuild one of your entries.
4. If no problem occurs, edit the plugin file and set $FORCE_PD_REFRESH variable to 0, again.
Posted by: (o) | July 9, 2005 03:47 PM
I do not notice a really significant difference.
What can I do?
Posted by: Joerg | July 10, 2005 11:31 PM
Are you using SQLite? If so, you can't use MT::PluginData properly and must set $ENABLE_PD_INDEXES to 0 to make tagwire work. This problem is caused by the current releases of Movable Type and will be fixed by the feature releases.
Posted by: (o) | July 11, 2005 09:07 AM
No, I use a mySQL normal database with mt.
Posted by: Joerg | July 12, 2005 04:55 AM
O.k. May be you have so many entries and tags, or there's something wrong in your template. Anyway we have two options:
$ENABLE_PD_INDEXES = 1: (default)
Updates tag indexes upon the DB everytime you save a entry, and uses them while rebuilding. This option makes saving slower and rebuilding quicker.
$ENABLE_PD_INDEXES = 0:
Does nothing when you save a entry, and generates tag indexes on memory and uses them while rebuilding. This option makes saving quicker and rebuilding slower (but not so much slower).
If you have no objection to trying the latter, I'd like to hear how it works in your environment.
Posted by: (o) | July 12, 2005 05:20 AM
So how do we make a tag entry listing page for each tag, just like you have done on your site... you earlier said you will post on that? did you?
Posted by: haydur | July 22, 2005 04:46 AM
Can you explain on creating tag entry listing pages for each tag just like you have on your site?
Posted by: haydur | July 22, 2005 04:47 AM
Have you read http://as-is.net/hacks/2005/06/dynamic_tag_archiving.html ?
My intention to this article is to explain how you make a tag entry listing page for each tag.
Posted by: (o) | July 22, 2005 10:27 AM
Great plugin! One feature request: something like so that I can know whether an entry has tags before I attempt to display them...
Posted by: ahj | August 11, 2005 05:59 AM
Thank you for your suggestion, Andrew. I filed it for the future release.
If you can't wait, you can also do it as like:
<MTIfNonEmpty tag="MTEntryKeywords">
<MTEntryTags>...</MTEntryTags>
<MTElse>
... Something to do when no tags appear ...
</MTElse>
</MTIfNonEmpty>
Posted by: (o) | August 14, 2005 02:37 PM
The "MTIfNonEmpty" solution works fine -- there's probably no need for any change to the plugin!
Apologies for the fact that some of my comment got "eaten" since I didn't encode the < ... > symbols!
Also, an unrelated note: you may want to include some documentation on (or pointers to) information on things like using the <category> entity in RSS (and the atom equivalents) to get the tags to show up in technorati when you don't have them in the body of the post.
Posted by: ahj | August 14, 2005 04:33 PM
Hi Hirotaka,
This seems like a great plugin ... I'm going take a look at it shortly, but I wanted to ask you how well Tagwire plays with dynamic MT sites? Maybe once I have some coffee (it's early in the morning here in this part of Canada) and have looked through your code, I could figure it out myself, but I thought I'd ask here first :^)
Posted by: Patrick Taylor
|
August 23, 2005 08:05 PM
In short, it doesn't support MT's Dynamic Publishing currently.
Posted by: (o)
|
August 23, 2005 08:38 PM
Hi,
I installed the plug into the MT plugin directory. It is shown within the plugin section in the backend of mt and shoul work unfortunately the new resources provided by tagwire do not work...
Posted by: Philcomputing
|
November 12, 2005 11:49 PM
Hello...
I installed the Tagwire plug-in. It didn't work. So I disabled it and then uninstalled it.
Now, my rss and ATOM feeds do not show my categories. Below is a sample from a recent feed:
A new journalist-blogger...
-
Mike Brothers, of the Springfield News-Leader, may start a weblog. Mike, Paul Katona (my Radio Rhetorica co-host), and I have a conversation about it at the Springfield Bloggers meetin' place--the Patton Alley Pub.
http://rhetorica.net/archives/004823.html http://rhetorica.net/archives/004823.html Fri, 11 Nov 2005 20:48:27 -0600
Note the closed category tag, but no open category tag and no category.
Before I installed Tagwire everything worked fine (including pings to Technorati). Now, none of my weblogs generate the proper
Any ideas?
Thanks!
Posted by: acline
|
November 13, 2005 05:16 AM
Did you assign proper categories to the entry?
Posted by: (o)
|
November 13, 2005 06:12 AM
The plugin does not work....
I tried to list tags of the entries and their related tags, and to link all of them to Technorati results in the following:
* " rel="TAG" title="TAG:"> ()
* Total Tags:
* Total Tags(Sum):
Posted by: Philcomputing
|
November 13, 2005 07:38 PM
I'm doing nothing differently. I'm using MT3.2 and have been assigning categories successfully for years.
The tag is missing on the RSS output as I demonstrated above. This never happened before Tagwire. Take another look:
http://rhetorica.net/archives/004823.html
http://rhetorica.net/archives/004823.html
Fri, 11 Nov 2005 20:48:27 -0600
There's only a closed tag and no open tag or information.
Posted by: acline
|
November 14, 2005 07:39 AM
I really understood what you wrote. But it's not possible to happen as far as you assign categories properly and write the RSS templates exactly as follows:
<category><$MTEntryCategory remove_html="1" encode_xml="1"$></category>
The problem isn't related to my plugin, anyway, anyhow.
Posted by: (o)
|
November 14, 2005 07:51 AM