Archive for September, 2008

Manual page of CustomFieldsSearch

Tuesday, September 23rd, 2008

search

Search word

<input name="search" />

includeBlogs

blogs

<input type="hidden" name="IncludeBlogs" value="<$mt:BlogID$>" />

CustomFieldsSearch

Enable to search by Custom Fields value.

<!-- requiring this settings. -->
<input type="hidden" name="CustomFieldsSearch" value="1" />

CustomFieldsSearchClassType

Specify object type

Effective value

entry
Search of Entry.
page
Search of Page.
<input type="hidden" name="CustomFieldsSearchClassType" value="entry" />

CustomFieldsSearchIgnore

When the column that is not the custom fields is disregarded, it specifies it.(tag name)

Effective value

EntryTitle
TITLE
EntryBody
BODY
EntryMore
BORE
EntryKeywords
KEYWORDS
<input type="hidden" name="CustomFieldsSearchIgnore" value="EntryTitle" />
<input type="hidden" name="CustomFieldsSearchIgnore" value="EntryBody" />
<input type="hidden" name="CustomFieldsSearchIgnore" value="EntryMore" />
<input type="hidden" name="CustomFieldsSearchIgnore" value="EntryKeywords" />

CustomFieldsSearchField

The column made the key to the search is specified. (tag name)

The setting of CustomFieldsSearchField is given to priority when the same column as both CustomFieldsSearchIgnore and CustomFieldsSearchField is specified.

Effective value

EntryTitle
TITLE
EntryBody
BODY
EntryMore
MORE
EntryKeywords
KEYWORDS
Tag name of field added in Custom Fields
Field added in Custom Fields
<input type="checkbox" id="CustomFieldsSearchField_title" name="CustomFieldsSearchField" value="EntryTitle" /><label for="CustomFieldsSearchField_title">: Title</label>
<input type="checkbox" id="CustomFieldsSearchField_booken_price" name="CustomFieldsSearchField" value="booken_price" /><label for="CustomFieldsSearchField_booken_price">: Price</label>

CustomFieldsSearchFieldLike

CustomFieldsSearchFieldIn

CustomFieldsSearchFieldEquals

It narrows it by specified key and value. (tag name + condition)

<select name="CustomFieldsSearchFieldLike">
    <option value="">-- any publishers --</option>
    <option value="booken_pub:O'Reilly">O'Reilly</option>
    <option value="booken_pub:Pragmatic Bookshelf">Pragmatic Bookshelf</option>
    <option value="booken_pub:Wiley">Wiley</option>
    <option value="booken_pub:Apress">Apress</option>
</select>
<input type="checkbox" id="CustomFieldsSearchFieldIn_booken_year_2006" name="CustomFieldsSearchFieldIn" value="booken_year:2006" /><label for="CustomFieldsSearchFieldIn_booken_year_2006">: 2006</label>
<input type="checkbox" id="CustomFieldsSearchFieldIn_booken_year_2007" name="CustomFieldsSearchFieldIn" value="booken_year:2007" /><label for="CustomFieldsSearchFieldIn_booken_year_2007">: 2007</label>
<input type="checkbox" id="CustomFieldsSearchFieldIn_booken_year_2008" name="CustomFieldsSearchFieldIn" value="booken_year:2008" /><label for="CustomFieldsSearchFieldIn_booken_year_2008">: 2008</label>

CustomFieldsSearchLucky

“I’m Feeling Lucky” function is offered. (Move directly to the first entry. )

<input type="submit" name="CustomFieldsSearchLucky" value="I'm Feeling Lucky" />

CustomFieldsSearchLuckyArchiveType

The archive type when “I’m Feeling Lucky” function is used is specified.

Effective value

Same as EntryPermalink.

<input type="hidden" name="CustomFieldsSearchLuckyArchiveType" value="Individual" />

Demonstration of CustomFieldsSearch

Tuesday, September 23rd, 2008

Field and the content

It is composed of the following fields.

name content tag type
Title Title of the book MTEntryTitle default
Description Description MTEntryBody default
ISBN ISBN booken_isbn text
Price Price booken_price text
Publisher Publisher booken_pub dropdown
Year Published year booken_year dropdown

Registered entries and example of search form

The following entries are registered.

About of search form

  • When the text is input to “Free word”, matching against the column that checked in the check box.
  • It is possible to narrow it by specifying “Publisher”.
  • It is possible to narrow it by specifying “Published year”. This part specified the condition with “OR search”.
  • “Free word”, “Publisher”, and “Publication year” become the “AND search”.

HTML Source of search form

<form method="get" action="<$mt:CGIPath$><$mt:SearchScript$>">
  <input type="hidden" name="CustomFieldsSearch" value="1" />
  <input type="hidden" name="CustomFieldsSearchClassType" value="entry" />
  <input type="hidden" name="CustomFieldsSearchIgnore" value="EntryTitle" />
  <input type="hidden" name="CustomFieldsSearchIgnore" value="EntryBody" />
  <input type="hidden" name="CustomFieldsSearchIgnore" value="EntryMore" />
  <input type="hidden" name="CustomFieldsSearchIgnore" value="EntryKeywords" />
  <input type="hidden" name="IncludeBlogs" value="<$mt:BlogID$>" />

  <fieldset id="freeword_set">
    <legend>Free word</legend>
    <input type="text" id="search_free" class="ti" name="search" value="<$mt:SearchString$>" /><br />
    <input type="checkbox" id="CustomFieldsSearchField_title" name="CustomFieldsSearchField" value="EntryTitle" /><label for="CustomFieldsSearchField_title">: Title</label>
    <input type="checkbox" id="CustomFieldsSearchField_text" name="CustomFieldsSearchField" value="EntryBody" /><label for="CustomFieldsSearchField_text">: Description</label>
    <input type="checkbox" id="CustomFieldsSearchField_booken_isbn" name="CustomFieldsSearchField" value="booken_isbn" /><label for="CustomFieldsSearchField_booken_isbn">: ISBN</label>
    <input type="checkbox" id="CustomFieldsSearchField_booken_price" name="CustomFieldsSearchField" value="booken_price" /><label for="CustomFieldsSearchField_booken_price">: Price</label>
  </fieldset>

  <fieldset>
    <legend>Publisher</legend>
    <select name="CustomFieldsSearchFieldLike">
      <option value="">-- any publishers --</option>
      <option value="booken_pub:O'Reilly">O'Reilly</option>
      <option value="booken_pub:Pragmatic Bookshelf">Pragmatic Bookshelf</option>
      <option value="booken_pub:Wiley">Wiley</option>
      <option value="booken_pub:Apress">Apress</option>
    </select>
  </fieldset>

  <fieldset>
    <legend>Year</legend>
    <input type="checkbox" id="CustomFieldsSearchFieldIn_booken_year_2006" name="CustomFieldsSearchFieldIn" value="booken_year:2006" /><label for="CustomFieldsSearchFieldIn_booken_year_2006">: 2006</label>
    <input type="checkbox" id="CustomFieldsSearchFieldIn_booken_year_2007" name="CustomFieldsSearchFieldIn" value="booken_year:2007" /><label for="CustomFieldsSearchFieldIn_booken_year_2007">: 2007</label>
    <input type="checkbox" id="CustomFieldsSearchFieldIn_booken_year_2008" name="CustomFieldsSearchFieldIn" value="booken_year:2008" /><label for="CustomFieldsSearchFieldIn_booken_year_2008">: 2008</label>
  </fieldset>

  <input type="hidden" name="limit" value="2" />
  <input type="submit" accesskey="4" value="Search" />

  <input type="hidden" name="CustomFieldsSearchLuckyArchiveType" value="Individual" />
  <input type="submit" name="CustomFieldsSearchLucky" accesskey="5" value="I'm Feeling Lucky" />
</form>

Example of using MTIfCustomFieldsSearchField in search result page

<mt:IfCustomFieldsSearchField tag="booken_isbn">
<!-- When ISBN is only a search key, it is displayed. -->
ISBN: <MTbooken_isbn>
</mt:IfCustomFieldsSearchField>

<mt:IfCustomFieldsSearchField tag="booken_price">
<!-- When Price is only a search key, it is displayed. -->
Price: <MTbooken_price>
</mt:IfCustomFieldsSearchField>

About the CustomFieldsSearch

Tuesday, September 23rd, 2008

What’s this

  • Search by Custom Fields value.
  • Moreover, it is possible to search it for only the field that has been specified.
  • “AND Search” and “OR Search” can be possible.

What’s not this.

  • It doesn’t correspond to the “AND search” and the OR “search” by the notation that MT (since 4.2) has.
  • It doesn’t correspond to the category filtering and the author filtering by the notation that MT (since 4.2) has.

Requirements (freeword search)

  • MTOS
  • MT4

Requirements (all functions)

  • MTOS(4.2 or later)
  • MT4.2 or later

Installation

  1. Download archive from download page.
  2. Extract archive file, and upload these files to your plugin directory.
  3. Complete.

License

New BSD License

Usage of Dumper for the developer

Tuesday, September 23rd, 2008

Use it from other plugin.

It is possible to use it from other plugin by the following way.

Example

require MT;
my $app = MT->instance;
my $dumper = $app->component('Dumper');
my %config_hash = (
'dump_entry' => 1,
'dump_entry_yaml' => 1,
'dump_entry_yaml_file' => 'entries.yaml',
'dump_entry_fields' => {
'id' => 'id',               # Outout id field.
'title' => 'name',          # Output title field as name.
'permalink' => 'permalink', # Output Permalink.
'entry_email' => 'email',   # Output Custom Fields field that specified by tagname.
},
);
foreach my $k (keys %config_hash) {
$dumper->set_config_value($k, $config_hash{$k}, 'blog:1');
}
出力例(entries.yaml)

---
1:
id: 1
name: entry's title
permalink: http://tec.toi-planning.net/entry/permalink/
email: taku@toi-planning.net

Manual page of Dumper

Tuesday, September 23rd, 2008

Plugin Settins for blog

About the Dumper

Tuesday, September 23rd, 2008

What’s this

  • The content of the entry can be output by YAML and JSON format.
  • Because only the part with the change when entry’s is preserved is written, the processing speed is fast.

Requirements

  • MTOS
  • MT4

Installation

  1. Download archive from download page.
  2. Extract archive file, and upload these files to your plugin directory.
  3. Complete.

License

MIT License

Tag reference of Period

Tuesday, September 23rd, 2008

Tags

<MTPeriodEntries>

block

Entries are iterated specifying the period (to the end of period).

Usage

<MTPeriodEntries from="2008/1/1" to="today" sort_by="start">
from <MTPeriodStart> to <MTPeriodEnd>
<MTEntryBody>
</MTPeriodEntries>
Modifire

from=”YYYY/MM/DD [HH:MM:SS] | today | [-] N days”
The threshold in young one is specified.(default: 1970/1/1/)
to=”YYYY/MM/DD [HH:MM:SS] | today | [-] N days”
The threshold in old one is specified.(default: 2200/1/1/)
lastn=”N”
The first corresponding N matter is displayed.
sort_by=”start | end”
When start is permuted in the period end, end is specified when permuting it in the period beginning.
sort_order=”ascend | descend”
When ascend is displayed in the descending order, descend is specified when arranging it in ascending order.

<PeriodEntriesCount>

function

Display number of entries, of these “End of period” is included specific period.

Usage

Display number of entries, of these “End of period” is after 30 days from today.

<MTPeriodEntriesCount from="today" to="30 days" sort_by="start">
Modifire

Same as <MTPeriodEntries>.

<MTPeriodStart>

<MTPeriodEnd>

function

Displaying date.

Usage

<MTPeriodStart format="%Y/%m/%d %H:%M:%S"> 〜 <MTPeriodEnd format="%Y/%m/%d %H:%M:%S">
Modifire

Same as <MTEntryDate>

<MTPeriodStartDateEnable>

<MTPeriodStartTimeEnable>

<MTPeriodEndDateEnable>

<MTPeriodEndTimeEnable>

function

It truly becomes it when done effectively by setting the plug-in.

Usage

<MTIf tag="PeriodStartDateEnable">
a to which setting of "Date" of "Beginning at period" is effective
<MTIf>

Details of ScriptInjection

Tuesday, September 23rd, 2008

Initialized variable

inputs

It is a hush of the input element of custom fields.

Fields other than date type

inputs['Label of field'] // The element can be acquired from the label of the field. 
inputs['Tagname of filed'] // The element can be acquired from the tagname of the field. 
Field of date type

inputs['Label of field']['date'] // The input element to the date can be acquired. 
inputs['Label of filed']['time'] // The input element to the hour can be specified. 

Manual page of ScriptInjection

Tuesday, September 23rd, 2008

Plugin Settins for blog

Create Entry

About the ScriptInjection

Tuesday, September 23rd, 2008

What’s this

  • The insertion of arbitrary JavaScript is enabled to the entry edit page.

Requirements

  • MTOS
  • MT4

Installation

  1. Download archive from download page.
  2. Extract archive file, and upload these files to your plugin directory.
  3. Complete.

License

MIT License