Home > MovableType > Movable Type: MTPaginate でアーカイブページを分割する

Movable Type: MTPaginate でアーカイブページを分割する

先日、Movable Type で管理しているブログを PHP 化したので、アーカイブページを分割するプラグイン MTPaginate を試してみました。

とりあえず、カテゴリー・アーカイブをページ分割してみます。

プラグインをインストール

MTPaginate 1.28 をダウンロードして、plugins フォルダの中にある MTPaginate フォルダを MT/plugins フォルダにアップロード。

テンプレートの書き換え

カテゴリー・アーカイブのテンプレート内にある <MTEntries> の直前に以下のソースをペースト。

<!-- MTPaginate [1/2] begin -->
<MTPaginate>
<MTPaginateIfMultiplePages>
<p class="multiplepages">
<MTPaginateIfLastPage_>
<a href="<$MTPaginatePreviousPageLink$>" title="Previous"> ≪ </a>
</MTPaginateIfLastPage_>
<MTPaginateIfMiddlePage_>
<a href="<$MTPaginatePreviousPageLink$>" title="Previous"> ≪ </a>
</MTPaginateIfMiddlePage_>
|<$MTPaginateNavigator format_all=" All " place_all="after" separator="|">|
<MTPaginateIfMiddlePage_>
<a href="<$MTPaginateNextPageLink$>" title="Next"> ≫ </a>
</MTPaginateIfMiddlePage_>
<MTPaginateIfFirstPage_>
<a href="<$MTPaginateNextPageLink$>" title="Next"> ≫ </a>
</MTPaginateIfFirstPage_>
</p>
</MTPaginateIfMultiplePages>
<MTPaginateContent max_sections="10">
<!-- MTPaginate [1/2] end -->

</MTEntries> を以下に書き換え。ペーストじゃなく書き換え。

<!-- MTPaginate [2/2] begin -->
<$MTPaginateSectionBreak$>
</MTEntries>
</MTPaginateContent>
</MTPaginate>
<!-- MTPaginate [2/2] end -->

再構築して完了です。

分割したページの URL は、

http://www.hogehoge.com/category/index.php?page=4

みたいな感じになりました。

URL の中に ? が入るのが嫌だな。

参考にさせていただいたページ

ありがとうございます。

関連する記事

Comments: 0

Comment Form
Remember personal info

Trackback+Pingback: 0

TrackBack URL for this entry
http://bowz.info/920/trackback
Listed below are links to weblogs that reference
Movable Type: MTPaginate でアーカイブページを分割する from Bowz::Notebook

Home > MovableType > Movable Type: MTPaginate でアーカイブページを分割する

タグクラウド

Return to page top