Replaces the <MTEntries> tag by providing entries that contain a matching KeyValue. May be used anywhere MTEntries can be and can return entries from multiple blogs.
Decompress the archive and place the file "keyvalue_entries.pl" into your plugin directory which is located in the same directory as mt.cgi.
Now when you go into the Movable Type overview page you should see KeyValue Entries listed as a plugin. If you do not make sure your ftp client is set to upload the plugin in text mode rather than binary.
A replacement for the MTEntries tag that returns entries based upon matching keyvalues. You can specify the term or match or use a regular expression based match, in an entry context the current value for the key will be used if a value is not supplied.
<MTKeyValueEntries key="Foo" lastn="5" include_blogs="3,4,5" sort_order="random">
<MTKeyValues>
<MTEntriesHeader><h3>More related to foo...</h3>
<ul class="more"></MTEntriesHeader>
<li><a href="<$MTEntryLink$>"><$MTEntryTitle$></a></li>
<MTEntriesFooter></ul></MTEntriesFooter>
</MTKeyValues>
</MTKeyValueEntries>
The key to search in for matches.
key="foo"The text value to search for inside the key provided above.
Either this or the pattern argument is required outside an entry context.
value="foo"The regex pattern to search for, for more info see the Regex plugin documentation.
Either this or the value argument is required outside an entry context.
pattern="m/(apple|orange|banana)/i"A list of blog ids to include in the search. (Default is to include all.)
Cannot be used with the exclude_blogs argument.
include_blogs="1,3,8"A list of blog ids to exclude in the search. (Default is to exclude none.)
Cannot be used with the include_blogs argument.
exclude_blogs="2,6"The sort order of the returned entries. Operates the same as the standard MTEntries tag but adds a random option. (Defaults to the sort order preference of the current blog.)
sort_order="ascend|descend|random"The field to sort the returned entries by, has some more variables than MTEntries. (Defaults to title.)
sort_order="title|created_on|modified_on|author_id|excerpt|id|basename|blog_id"If a value of '1' is used the value and possible results are put through a filter to catch any inconsistencies between matches and the value. The filter makes the following conversions:
Will be ignored when used in combination with the pattern variable.
clean="0|1"Specifies the entry field in which to look for KeyValues. Default is
the extended entry field i.e. text_more.
The delimiting character you use between the key and value in KeyValues should be set the same as there, defaults to '='.
delimiter="="The number of entries to return, the default being to return all found entries.
lastn="5"Skip a certain number of entries, unlike MTEntries it does not require the use of lastn.
offset="2"The MTEntries arguments category, author and days are not supported.
If you would like to change the default for the delimiter you can change it on the following line of the plugin code. Change the "=" to the delimiter you use.
my $delimiter = $args->{delimiter} || "=";
<MTKeyValues> must be placed inside of <MTKeyValueEntries> if you need to use key values from the entries in the entry list.
© Copyright 2004 Michael Sheets