My favorites | Sign in
Project Logo
                
Search
for
Updated Feb 04, 2010 by hirotaka...@gmail.com
Labels: MT, Plugin
Locales: en, ja
Tagwire_Plugin  
A plugin for handling entries' keywords as "tag" in Movable Type.

Tagwire Plugin

A plugin for handling entries' keywords as "tag" in Movable Type.

Changes

Overview

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:

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

Tags & Filters

From here we will explain MT container/varable tags introduced by Tagwire Plugin.

MTTags Container

A container tag for listing all available "tags" for the current blog.

Option(s)

Available tags in this container

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>

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)

Available tags in this container

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)

Available tags in this container

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)

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)

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 Container

A container tag for listing the query string of MT-XSearch as tags. It can only be used in "MT-XSearch" Template.

Option(s)

Available tags in this container

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>

See Also

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)


Sign in to add a comment
Powered by Google Project Hosting