ページめぐり

ついでに、ですが。

修正のついでにページめぐり機能とか実装してみました。

ただ、もうちょっとカスタマイズしないと、あまりにも見た目が酷いかなぁという感じですが。


で、ページめくりの実装方法ですがSix Apartのページで紹介されている方法を使いました。

最初はブログの管理画面にあるデザインのテンプレートから、以下の内容でテンプレートモジュール「ページ分割」を作ります。

<div class="content-nav">
<MTIfPreviousResults><a href="<MTPreviousLink encode_html="1">" rel="prev">
« Previous</a>  </MTIfPreviousResults>
<MTPagerBlock>
<MTIfCurrentPage><MTVar name="__value__"><MTElse><a href="<MTPagerLink encode_html="1">"><MTVar name="__value__"></a></MTIfCurrentPage>
<mt:unless name="__last__"> </mt:unless>
</MTPagerBlock>
<MTIfMoreResults>  <a href="<MTNextLink encode_html="1">" rel="next">
Next »</a>
</MTIfMoreResults>
</div>

次に、.htaccessファイルを変更します。

RewriteRule ^(.*)$ /mtview.php [L,QSA]
と書かれている行を
RewriteRule ^(.*)(¥?.*)?$ /mtview.php$2 [L,QSA]
に変更します。

で、ブログの管理画面にあるデザインのテンプレートからメインページを編集します。

<div id="alpha-inner">
<strong><mt:Entries>
</strong><mt:Ignore><!-- Use the Entry Summary module for each entry published on this page --></mt:Ignore>
と書かれている行を
<div id="alpha-inner">
<strong><mt:Entries offset="auto" limit="auto"></strong>
<mt:Ignore><!-- Use the Entry Summary module for each entry published on this page -->
と書き換えます。

次にその下にある

<div class="content-nav">
<a href="<$mt:Link template="archive_index"$>">アーカイブ</a>
</div>
と書かれている部分に
<div class="content-nav">
<a href="<$mt:Link template="archive_index"$>">アーカイブ</a>
</div>
<strong><$mt:Include module="ページ分割"$>
</strong>
という感じで追加します。

そうするとブログ画面の下部にページ分割が表示されるのですが、、、。
前述の通り、全部のページがだーっと表示されてしまうので、見た目が今ひとつなんです。。。