いよいよ最終章、第3回です。
・「保存と再構築」ボタンで、ページを再構築する。
Webショップらしくなるように、カスタマイズを行なっていきます。
10-1.新着情報カテゴリの最新記事を3件表示しよう。
1)モジュールを流用・変更
・ウィジェットテンプレート「最近のブログ記事」を参考にします。
メニュー「デザイン」?ウィジェット?ウィジェットテンプレート一覧

最近のブログ記事:
<mt:If tag="BlogEntryCount">
<mt:Entries lastn="10">
<mt:EntriesHeader>
<div class="widget-recent-entries widget-archives widget">
<h3 class="widget-header">最近のブログ記事</h3>
<div class="widget-content">
<ul>
</mt:EntriesHeader>
<li><a href="<$mt:EntryPermalink$>">
<$mt:EntryTitle$></a></li>
<mt:EntriesFooter>
</ul>
</div>
</div>
</mt:EntriesFooter>
</mt:Entries>
</mt:If>
解説:
・ <mt:If tag="BlogEntryCount"> ブログ記事が存在している場合
・ <mt:Entries lastn="10"> ブログ記事、最新10件を表示
・ <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a> エントリータイトル表示、その記事へのリンク
2)テンプレートモジュールの作成
メニュー「デザイン」?テンプレート?テンプレートモジュールの作成
名前:top-news
上記テンプレートの変更内容
・カテゴリ「新着情報」の最新記事を3件
→ <mt:Entries category="<100>新着情報" lastn="3">
・タイトルの変更 → ○○ショップ新着情報
・出力内容:日付、本文の頭の20文字表示
→ <$mt:EntryBody words="40"$> <$mt:EntryDate format="%x">
top-news テンプレートモジュール
<mt:If tag="BlogEntryCount">
<mt:Entries category="<100>新着情報" lastn="3">
<mt:EntriesHeader>
<div class="widget-recent-entries widget-archives widget">
<h3 class="widget-header">○○ショップ新着情報</h3>
<div class="widget-content">
<ul>
</mt:EntriesHeader>
<li><$mt:EntryDate format="%x"$>:
<a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a><br />
<$mt:EntryBody words="40"$>
</li>
<mt:EntriesFooter>
</ul>
</div>
</div>
</mt:EntriesFooter>
</mt:Entries>
</mt:If>
「保存」ボタンで新規作成、保存。3)「メインページ」テンプレートへモジュールを挿入
<$mt:Include module="top-news"$>
・<mt:Entries>の上に挿入
21行目あたり
<div id="alpha">
<div id="alpha-inner">
<mt:Entries>
<mt:Ignore><!-- Use the Entry Summary module for each entry published on this page --></mt:Ignore>
<$mt:Include module="ブログ記事の概要"$>
</mt:Entries>
・「保存と再構築」ボタンで、ページを再構築する。
新着情報カテゴリが、右コンテンツ上部に表示される。
続きを読む: 10.トップページのカスタマイズ

